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.

Redirect to secure

Discussion in 'General Discussion' started by logikstudios, Apr 22, 2007.

  1. logikstudios

    logikstudios Well-Known Member

    Joined:
    Nov 2, 2006
    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    Hi. In Cpanel, if i goto the redirect tab. It will allow me to redirect as normal. However it will not let me redirect to a secure path on the site such as https://yourdomain.com/files/thisfile.php

    Is there a way around this?

    THanks,
     
  2. kingjj

    kingjj Registered

    Joined:
    Apr 16, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    You could always try adding this to a .htaccess in the directory which you want secured:

    PHP:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond 
    %{SERVER_PORT} !443$
    RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
    </IfModule>
    This will re-write all accesses in that directory ad subsequent directories to your https. You will need mod_rewrite installed.
     
Loading...

Share This Page