Jump to content

Recommended Posts

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?

 

 

Link to comment
https://forums.phpfreaks.com/topic/219563-htaccess-redirect-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.