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.

Access to dir by SSL Only

Discussion in 'General Discussion' started by netnameus, Apr 14, 2005.

  1. netnameus

    netnameus Well-Known Member

    Joined:
    Mar 7, 2004
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    How can I make it so http://secure.mydomain.com can only be accessed by https:// ?

    I thought I've seen a page that displayed an error unless I accessed by https://

    Thanks
     
  2. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    you might be able to do a mod_rewrite rule in the .htaccess for that.
     
  3. Trigger

    Trigger Well-Known Member

    Joined:
    May 17, 2003
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane
    create a .htaccess file and use the following

    Code:
    RewriteEngine On
    RewriteCond %{SERVER_PORT} !443
    RewriteRule (.*) https://secure.mydomain.com/ [R]
    Then upload it into the folder, this will redirect any http access to the https access
     
  4. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Assuming that you'll be using the IP address of the main domain, you need a secure certificate issued specifically for secure.domain.tld

    Save a copy of the
    key in /usr/share/ssl/private/secure.domain.tld.key
    cert in /usr/share/ssl/certs/secure.domain.tld.crt

    Insert the following syntax in your httpd.conf file:

    Restart Apache through WHM. DONE!

    Hope this helps!
     
Loading...

Share This Page