Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] .htaccess redirect from https to http shows the "index.php?"
#2

[eluser]PowerCode[/eluser]
In your application/config/config.php, change $config['index_page'] = "index.php?"; into $config['index_page'] = "";.

EDIT: I just noticed that you're doing a redirect from .htaccess itself, so above solution won't work. Lemme have a closer look at the problem...

EDIT 2:

Code:
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (auth)
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(auth)
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /$1

I think you'll need to change the /index.php?/$1 to /$1 as above. This is because once the redirect has been done from or to HTTPS/HTTP, the rule to rewrite everything to /index.php?/$1 would be executed regardless.

On a side note, I've just changed the ordering of the rewrite rule above too, since I think it looks more logical (I believe rewrite rules are traversed in order they've mentioned). Though it might not make any difference.


Messages In This Thread
[SOLVED] .htaccess redirect from https to http shows the "index.php?" - by El Forum - 12-29-2008, 10:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB