The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help with a simple redirect.

Discussion in 'General Discussion' started by jols, Oct 16, 2006.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    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]
     
  2. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    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]
     
Loading...

Share This Page