What I want to do is make it so if a user types in subdomain.domain.com, it will drop the subdomain and replace it with a www, unless it's an actual subdomain on the site.
This is what I have so far, I'm stumped (regexp sucks so hard %-(). M I doin it rite? It recognizes real subdomains, but it doesn't change the URL in the user's browser.
- Code: Select all
Options +FollowSymLinks
# Turn on mod_rewrite
RewriteEngine On
# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.|mail\.|blogs\.)?website\.net$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.|mail\.|blogs\.)?([^\.]+)\.website\.net$ [NC]
RewriteRule ^.*\.website\.net/(.*)$ %{HTTP_HOST}www\.website\.net/$1 [QSA,L,R]