herghost Posted November 23, 2010 Share Posted November 23, 2010 Hi all, I am trying to force ssl on a file in root and a whole folder. This is what I have so far: Options +FollowSymLinks RewriteEngine on # Ensure Correct Host RewriteCond %{HTTP_HOST} ^domain\.co.uk$ RewriteRule ^(.*)$ http://www.buy2earn.co.uk/$1 [L,R=301] # SSL Exception Here RewriteCond %{SERVER_PORT} !^443 RewriteCond %{REQUEST_FILENAME} myaccount.php RewriteRule ^(.*)$ https://www.buy2earn.co.uk/$1 [R,L,S=5] # Redirect all other pages to Non-SSL RewriteCond %{SERVER_PORT} !^80$ RewriteCond %{REQUEST_FILENAME} !myaccount.php ## Specify file types to ignore with rewrite RewriteCond %{REQUEST_URI} !(js|css) RewriteRule .? http://www.buy2earn.co.uk%{REQUEST_URI} [L,R=301] RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} livezilla RewriteRule ^(.*)$ https://www.buy2earn.co.uk/livezilla/$1 [R,L] # Redirect SSL Bots to SSL Robots.txt RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^robots.txt$ robots_ssl.txt This kind of works, all files in root apart from myaccount redirect to www and myaccount loads as https. However I am having problems with the livezilla folder, as myaccount access these files this needs to be read in https too, which works fine if no .htaccess exists. However this is the problem I am getting: http://www.buy2earn.co.uk/livezilla/livezilla/livezilla/livezilla/livezilla/livezilla/livezilla/livezilla/livezilla/livezilla/livezilla/chat.php Far to many redirects! Whats my problem? Quote Link to comment https://forums.phpfreaks.com/topic/219563-htaccess-redirect-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.