Forum Moderators: phranque
[maindomain.com...] (yes, the folder's name is "addondomain.com"
to
[addondomain.com...]
?
I have tried
RewriteEngine on
RewriteCond %{HTTP_HOST} ^maindomain.com/~username/addondomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.maindomain.com/~username/addondomain.com$
rewriteRule ^(.*) [addondomain.com...] [R=301,L]
But this is not working.
[edited by: MWpro at 3:15 am (utc) on Feb. 17, 2009]
RewriteCond %{HTTP_HOST} ^(www\.)?maindomain\.com
RewriteRule ^~username/addondomain\.com(.*)$ http://www.addondomain.com$1 [R=301,L]
Jim
There are many, many factors involved in getting the code "just right" and unfortunately, you'll have to do most of the work to figure it out; There are no "one-size-fits-all" or universal cut-and-paste solutions, because server configurations, URL-structure, and file organization differs so much between sites and servers.
Therefore, a lot of experimentation and troubleshooting is required, especially in cases when a new rule is the only rule in .htaccess, or when there are very few rules. If this rule *is* the only rule, then try simpler tests, such as:
RewriteRule ^foo\.html$ http://www.google.com/ [R=301,L]
Jim