I have a domain name maindomain.com
In the main domain I have a blog. The main domain is not active now. So all requests to site root index.php is redirected to maindomain.com/blog using htaccess.
I have this in htaccess for redirection
Redirect /index.php http://www.maindomain.com/blog/
Options All -Indexes
Everything works fine.
Now I added an Addon domain. The addon domain root folder is maindomain.com/addondomain.com
addondomain.com folder has an index.php. When I am accessing addondomain.com in the browser its getting redirected to http://www.maindomain.com/blog/ How to prevent this?
I assume that your additional domain has a different host: addondomain.com ?
In this case, simply add this condition to your .htaccess:
RewriteCond %{HTTP_HOST} maindomain.com$ [NC]
So the full redirection rule would look like this:
RewriteCond %{HTTP_HOST} maindomain.com$ [NC]
RewriteRule /index.php$ http://www.maindomain.com/blog/ [R]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With