Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Need Help with .htaccess and folder to subdomain redirect

Discussion in 'General Discussion' started by bpat1434, May 25, 2008.

  1. bpat1434

    bpat1434 Well-Known Member

    Oct 2, 2004
    Likes Received:
    Trophy Points:
    Columbia, MD
    I've got an SSL cert set up for a sub-domain and I'd like to (1) deny users the ability to reach the subdomain without SSL and (2) not allow users to reach the folder via: domain.tld/sub.

    cPanel by default creates subdomains in a folder in the document root. I'd like to disable people from reaching the subdomain via the "/subdomain" folder link, so I've set up my .htaccess like so:

    RewriteEngine On
    # If they're not using SSL, force them to use it.
    RewriteCond %{HTTPS} !=on
    RewriteRule .* [R,L]
    # If they're reaching the page via:,
    # make them use
    RewriteCond %{HTTP_HOST} !^manager\.domain\.com$ [NC]
    RewriteRule ^.* [R,L]
    Now this gives me an infinite loop issue. Is there another solution to my problem?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice