OK, I've been searching numerous discussion boards and searching the archives and the web for just the right answer to this question, even posted related questions on a couple, and got some responses, but they never really 'Solved' my dilema.
I've concluded that I can't use a url like
http://username.domainname.com unless I actually have a sub-domain set up for it, and I can't create a catchall sub-domain using WHM by using '*'.
SO, I've decided I can live with a url like this:
http://www.domainname.com/username
The objective is to capture what is entered as the username, and then redirect to an active php page that will take that username, assign it to a session variable, and do a DB query for all the information about that member to be displayed.
Here is my question:
If I have the following in the .htaccess file:
RewriteEngine On
RewriteRule ^member/[a-zA-Z0-9]+$ index.php?m=$1 [NC,L] # captures member username no case last rule
and the URL they used to get there was http://www.domainname.com/member/username
it will be looking for the 'index.php' to be located in the member directory, right?
But, if I want it redirected to the www.domainname.com/index.php page, how would I write that in the RewriteRule? Can you go back a directory with ../ or is there another way to accomplish that without having to use the domain name (keeping it transportable between domains)
I would like it to go to the domain index page where I can capture the value of m which will be checked against the database for a matching member username, and display their website if a match exists, but if no match exists, then I can just display a message that this is a member only site, or whatever.
This doesn't seem like it should be that difficult to do, but I've been beating my head against this computer monitor for days.
Any assistance with this request would be GREATLY appreciated.
Hopefully I will get a final resolution here today, so I can move on with this project.
Thanks in advance.
Doug