Welcome Guest, Not a member yet? Register   Sign In
HTTPS and Remove index.php on CodeIgniter
#1
Lightbulb 

I am using codeigniter framework,set .htaccess file to remove index.php and trying to enable HTTPS protocol for the server, and something happened.
HTTP:
  1. Everything is okay, when I access http://www.example.com/controller/method orhttp://www.example.com/index.php/controller/method
HTTPS:
  1. Everything is okay, when I access https://www.example.com/index.php/controller/method

  2. Got 404 not found when I access https://www.example.com/controller/method
I think that is .htaccess file problem, it is look like htaccess file not working for HTTPS protocol.
.htaccess file of my site.
Code:
DirectoryIndex index.php
RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

Is something wrong? thanks a lot.
Reply
#2

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

replace to

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php/$1
Reply
#3

(08-16-2016, 12:44 AM)chaegumi Wrote: RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

replace to

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

Still not work
Reply
#4

(08-16-2016, 02:54 AM)billk Wrote:
(08-16-2016, 12:44 AM)chaegumi Wrote: RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

replace to

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

Still not work

It's in your config file... http:// or https://
Reply




Theme © iAndrew 2016 - Forum software by © MyBB