Reputation: 15079
I've set a redirect rule in htaccess - but instead of redirecting the url to the right scheme (https) it first redirect to http. for example:
RewriteRule ^prefixurl/(aaa|bbb|ccc)/suffixurl$ prefixurl/ddd/suffixurl [R=301,QSA,L]
What happens is I get from :
--> (redirects to)
--> (2nd redirect to)
(there is nginx server in front of Apache with directive to move all non https back to https...)
Why the redirect to http takes place ? any way to fix it ?
Upvotes: 1
Views: 126
Reputation: 785971
You may use this single rule to get your redirect and get https://
in redirected URL:
RewriteRule ^prefixurl/(aaa|bbb|ccc)/suffixurl$ https://%{HTTP_HOST}/prefixurl/ddd/suffixurl [R=301,NC,L]
Upvotes: 1