- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.*
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com
RewriteRule ^ http://www.domain.com/profiles.php?subdomain=%1 [L]
This used to work on a server running apache 1.x (at least, I think it was 1.x), but one we changed servers to a debian build, running apache2, it broke. Allow me to illustrate:
Previously:
user types in: longears.domain.com
user views page: www.domain.com/profiles.php?subdomain=longears
user sees in address bar: http://longears.domain.dom
Now:
user types in: longears.domain.com
user views page: www.domain.com/profiles.php?subdomain=longears
user sees in address bar: http://www.domain.com/profiles.php?subdomain=longears
As you can see, instead of the user seeing what they typed in, they are seeing what the rewrite rule rewrites.
The rule is working fine, but it's rewriting the address in the address bar. Normally, I'd be fine with this, but we've got search engine ranking that we don't want to loose.
I thank all in advance for their help.
db