While using codeigniter, I am facing some difficulties. That's about the index.php file in URLs.
CodeIgniter serves all it's pages using index.php. So, our url's should look like following:
http://www.example.com/codeigniter/index.php/something
I want to remove the index.php from URLs by editing the config.php file and creating an .htaccess file. After changing the config from
$config['index_page'] = 'index.php';
to
$config['index_page'] = '';
I am able to run my project without the index.php just like this:
http://www.example.com/codeigniter/something
So now, that link is working - but it's also working with the index.php fragment. I can also see the components with the http://www.example.com/codeigniter/index.php/something address.
My .htaccess file is :
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Now, I want to make my site only available without the index.php in my links. I don't want this site to run with the index.php file in the link. I want http://www.example.com/codeigniter/something to run perfectly and http://www.example.com/codeigniter/index.php/something not to run. How can I do this?