Forum Moderators: phranque
RewriteCond %{HTTP_HOST} !(ourhostingdomain.com/addondomain1)
RewriteCond %{HTTP_HOST} !^addondomain1.com$ [NC,OR]
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://www.addondomain1.com/$1 [R=301,L]
Each of your addon domains should have a domain-name-canonicalization redirect. phranque gave the standard form a few posts back:(This is the form for an https site. If it is http, remove the OR flag and the second Condition.)RewriteCond %{HTTP_HOST} !^example\.addon$ [NC,OR]
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://example.addon/$1 [R=301,L]
This means: If the requested host is anything other than "example.addon" (give your exact preferred form, whether it is with or without www), and/or if the request is not https, then redirect the request to https://example.addon.
This is not something I have control over.Yes, we understand how the primary/addon directory structure works. Looks like I was not the only person experiencing brain farts last night ;) so don't sweat it.
Are you suggesting this will do the job in .htaccess?:No. “ourhostingdomain.com/addondomain1” is not a hostname. It looks as if you have mixed up two different rules: one that is only for the primary domain--which has to be located in the master htaccess--and one for the addons.RewriteCond %{HTTP_HOST} !(ourhostingdomain.com/addondomain1)
RewriteRule ^/addondomain1(.*) http://www.addondomain1.com$1 [R=301,L] http://www.ourhostingdomain.com/addondomain1/index.html
and
http://www.ourhostingdomain.com/addondomain1/subfolder1/page3.html RewriteRule ^/addondomain1(.*) https://www.addondomain1.com$1 [R=301,L] RewriteRule ^/addondomain1(.*) https://www.addondomain1.com$1 [R=301,L]
The directory path where the rule is defined is stripped from the currently mapped filesystem path before comparison (up to and including a trailing slash). The net result of this per-directory prefix stripping is that rules in this context only match against the portion of the currently mapped filesystem path "below" where the rule is defined.