Everything i've seen shows how to map these to a folder with the same subdomain, but that's not what we want. Can this be done?
Here's the existing .htaccess:
- Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^$ /default.php [QSA,L]
RewriteRule ^([^/\.]+)$ /default.php?a=$1 [QSA,L]
RewriteRule ^([^/\.]+)/([^/\.]+)$ /default.php?action=$1&b=$2 [QSA,L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)$ /default.php?action=$1&b=$2&c=$3 [QSA,L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)$
/default.php?action=$1&b=$2&c=$3&d=$4 [QSA,L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([0-9]+).html$
/default.php?action=$1&b=$2&c=$3&d=$4 [QSA,L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([0-9]+).html$
/default.php?action=$1&b=$2&c=$3&d=$4&e=$5 [QSA,L]
So what we'd like is for
example.com/thissection/thispage/whatever.html
www.example.com/thissection/thispage/whatever.html
forums.example.com/thissection/thispage/whatever.html
users.example.com/thissection/thispage/whatever.html
All to end up at
www.example.com/thissection/thispage/whatever.html
Which is what happens right now just for
example.com/thissection/thispage/whatever.html and
www.example.com/thissection/thispage/whatever.html
Any help is appreciated. I know just enough mod rewrite to screw up the entire site.