Need help with a simple redirect.

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
I need to redirect any traffic using the secure prefix "https" to another URL in the same site that also uses the secure prefix.

I have tried putting up the following .htaccess file but it does not work. Does anyone have any ideas here? Thanks very much.

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} https://([a-z0-9-]+\.)*domain.com/ [NC]
RewriteRule /* https://domain.com/store [L,R]
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Finally figured this one out. For anyone interested, it goes like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^store\.domain\.com
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=permanent,L]