Welcome Guest, Not a member yet? Register   Sign In
.htaccess unwanted https on home codeigniter
#1

[eluser]Unknown[/eluser]
I would like some specific pages to turn HTTPS. The pages I want HTTPS works and turn HTTPS as intended, Problem occurs on the 'home' page wich is simply http://domain.tld

If I visit
Code:
http://domain.tld
from a non-https page, it works fine and keep HTTP protocol as intended, but if i visit that page from a HTTPS page, it goes HTTPS too, that only occurs on the basic home page
Code:
(http://domain.tld)

for example

Code:
Origin : http://domain.tld/search
To : http://domain.tld
Result : normal http://domain.tld

but

Code:
Origin : httpS://domain.tld/login
To : http://domain.tld
Result : httpS://domain.tld

However

Code:
Origin : httpS://domain.tld/login
To : http://domain.tld/search (and other non-https controllers)
Result : normal http://domain.tld/search as intended

This is the .HTACCESS I'm using now

Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  Options +FollowSymlinks

  RewriteBase /


    #remove www
    RewriteCond %{HTTP_HOST} ^www [NC]
    RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301]


    # Turn HTTPS on
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} (login|register|recovermail|recover|settings)
    RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]


    # Turn HTTPS off
    RewriteCond %{HTTPS} on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(assets|login|register|recovermail|recover|settings)
    RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

    #remove index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

    #trailing slash  
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ $1 [L,R=301]    

</IfModule>


So I need to remove that behavior that turns the front page https when visited from a https controller.

Thanks for any help!




Theme © iAndrew 2016 - Forum software by © MyBB