Parked domains and htaccess rewrite

Status
Not open for further replies.

Shockt

New member
Mar 12, 2007
123
1
0
I have a hosting account with my main domain and a bunch of parked domains. I'm having trouble adding a rewrite condition to my htaccess that will rewrite any domains that aren't my main domain to a subdirectory.

For example:
parkeddomain1.com rewrites to maindomain.com/sites
parkeddomain1.com/gayforum rewrites to maindomain.com/sites/gayforum
parkeddomain4.com/gayforum also rewrites to maindomain.com/sites/gayforum
 
  • Like
Reactions: agua


Try the following, haven't tested it though.

RewriteRule ^/(.*) http://maindomain.com/sites/$1
 
A buddy helped me out. This seems to work fine:

RewriteCond %{HTTP_HOST} !^www.maindomain.com$
RewriteCond %{REQUEST_URI} !^/sites/
RewriteRule ^(.*)$ /sites/$1 [NC,L]
 
Status
Not open for further replies.