Redirecting add-on subdomain away from main domain
Let's say I have 3 domains:
maindomain.com
addon1.com
addon2.com
My host does not allow me to move addon domains outside of the main domain's public_html folder.
So my addon1.com domain is available via:
, and and any optional trailing files/folder structure in the request to and any optional trailing files/folder structure in theh request to
-
Let's say I have 3 domains: maindomain.com addon1.com addon2.com My host does not allow me to move addon domains outside of the main domain's public_html folder. So my addon1.com domain is available via: , and wordle How do I create a rewrite rule that will redirect: 1. 2.
RewriteCond %{HTTP_HOST} ^addon1\.com\.maindomain\.com(.*)$ [OR] RewriteCond %{HTTP_HOST} ^www\.addon1\.com\.maindomain\.com(.*)$ RewriteRule ^(.*)$ "https\:\/\/addon1\.com\/$1" [R=301,L]
This works for part 1 above, but not for any optional trailing files/folder structure. And I'm very unclear how to do part 2.
To redirect both to0 -
To redirect both to
0 -
I don't have more advanced .htaccess rules memorized. I've always had good luck using online .htaccess generators though. However, is the cPanel >> Redirects interface not able to handle this for you? 0
Please sign in to leave a comment.
Comments
4 comments