I have to access http://example.com/ABC/some-controller
. As per CodeIgniter you have to follow http://example.com/ABC/index.php/some-controller
. Now I am using .htaccess
to remove index.php. The problem I am facing is , if I use .htaccess file , my facebook login is not working because somehow it is not picking up the GET variables set by FB.
My directory listing is as follows :
public_html
ABC (codeigniter folders inside this directory)
applications
system
.htaccess
index.php
Now contents of my .htaccess to remove index.php from url :
Options -Indexes
RewriteEngine On
RewriteBase /ABC
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ABC/index.php?/$1 [L]
In config.php I have set the uri protocol to AUTO.
Thing to note here is , if I don't use ?
in last line (of .htaccess), it won't let me display page without index.php and throws error No file specified
. If I use ?
then everything is fine , except , that my facebook login stops working when I add this in .htaccess file, it keeps redirecting again and again . each time with a new code in get parameter. In my localserver everything is working fine. (In my localserver's .htaccess file I am not using ?
in last line, so I don't have to write index.php nor I have problem in fb login). I guess code of my fb login is correct as it is working on localhost, so not posting that code here. Please help me out to config my .htaccess for webserver so that it can use "get" parameters also. I am using Arvix web hosting.