edvinson
asked on
Re-write question - faking subdomains
I would like 'fake' a subdomain.
If the user enters: someUsername.mysite.com
I would like the actual page to be:
mysite.com/?someUsername
Also have more questions, but will save them for once this gets working.
Thanks
If the user enters: someUsername.mysite.com
I would like the actual page to be:
mysite.com/?someUsername
Also have more questions, but will save them for once this gets working.
Thanks
ASKER
Where do I put that?
In my config file?
In my config file?
Yes; you could either put it in your httpd.conf if you have access to it, or in your .htaccess file. You may have to add the following line before the code I provided above:
RewriteEngine On
so:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^.*$ /\?%1
RewriteEngine On
so:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^.*$ /\?%1
ASKER
JamesCssl:
I tried this, and it did not work. I think it's because I am already using a subdomain:
dev.mysite.com
so, I suppose I can't use : username.dev.mysite.com ?
I tried this, and it did not work. I think it's because I am already using a subdomain:
dev.mysite.com
so, I suppose I can't use : username.dev.mysite.com ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Havent tried, been busy. But I am sure it will!
Thanks.
Thanks.
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^.*$ /%1
replace example.com with your domain