#1 (permalink)  
Old 05-25-2008, 04:30 PM
bpat1434's Avatar
Registered User
 
Join Date: Oct 2004
Location: Columbia, MD
Posts: 71
bpat1434 is on a distinguished road
Need Help with .htaccess and folder to subdomain redirect

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:

Code:
RewriteEngine On

# If they're not using SSL, force them to use it.
RewriteCond %{HTTPS} !=on
RewriteRule .* https://manager.domain.com [R,L]

# If they're reaching the page via: domain.com/manager,
# make them use manager.domain.com
RewriteCond %{HTTP_HOST} !^manager\.domain\.com$ [NC]
RewriteRule ^.* https://manager.domain.com [R,L]
Now this gives me an infinite loop issue. Is there another solution to my problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
htaccess , mod_rewrite , subdomain

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:28 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc