Reputation: 55
I have two domains pointing to the same website, domain A and domain B. I want:
I tried many solutions and I always get into redirection loop. Eg. I tried this:
RewriteCond %{SERVER_NAME} ^www\.domainb\.com$ [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
....
rest of the standard typo3 htaccess commands.
My code was after typo3 be redirection part and before "Main URL rewriting" part in the htaccess file. With code above I'm redirected to https but then "redirection loop" error is shown.
Any help is highly appreciated.
Upvotes: 2
Views: 4760
Reputation: 391
The only solution that worked for me was the following one:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
Upvotes: 0
Reputation: 346
This works for me :)
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} domainb\.com$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
I include this code right after this line with RewriteEngine On
.
Upvotes: 6
Reputation: 71
Try this:
RewriteRule ^http://www\.domainb\.com/(.*) https://www\.domainb\.com/$1 [R=301,L]
Upvotes: 0