Forum Moderators: phranque
Example:
[praveen.domain.com...] should be treated as [domain.com...] Where we will be having so many users.
Can you please help me in this regard.
Thanks in advance
Praveen
<snip>
[edited by: jdMorgan at 1:36 pm (utc) on Mar. 21, 2006]
[edit reason] No signatures, please. [/edit]
Jim
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mydomain\.com
RewriteRule ^index\.php$ /index.php?user=%2 [L]
But it is not working. It is showing the Webhoting site default page where it usually shows if the domain is registered with them and no file is uploaded. So, I think it is treating this as a new domain when I access it as [praveen.mydomain.com....]
Please help me out, I have been trying this for the last 2days without any success.
In order to do that, you need two more things in addition to the rewrite code itself:
1) You must define an A record or a CNAME to support wild-card DNS in your domain's zone file.
2) Your host must allow wild-card subdomains, and pass requests for them to your server.
If either of these is missing, then your code won't even be executed.
Jim
Now it is somewhat working but not completely. It is forwarding all teh members to the same URL.
[praveen.mydomain.com...] to [mydomain.com...]
It is not taking the Username from teh subdomain.
I am using:
RewriteCond %{REQUEST_URI}!^/index\.php
RewriteCond %{HTTP_HOST}!^www\.mydomain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com
RewriteRule ^$ /index.php?user=%1
Taken from one of your examples at [webmasterworld.com...]
Can you please suggest what might have gone wrong
Thanks
Praveen