In codeigniter by default, the index.php file will be included in every URLs, For example if you installed codeigniter locally like this “localhost/” or in a folder like this “localhost/codeigniter/”, if you want to go to any page, for ex: a page named demo, You should go to demo page like this “localhost/codeigniter/index.php/demo/”, otherwise you will get an error (“URL Not Found”).
You can easily remove this file by using a .htaccess file with some simple rules.
Copy this code and paste it into any text editor
RewriteEngine On | |
RewriteBase /{'<i>Your codeigniter folder name,if you installed codeigniter in a subfolder, Otherwise leave it with one backslash</i>'}/ | |
RewriteCond %{REQUEST_URI} ^system.* | |
RewriteRule ^(.*)$ /index.php/$1 [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L] |
and save the file with the name .htaccess, this file must be in your codeigniter root folder.
Now you can navigate your site’s structure without the index.php in front of every URL
Related Posts
Facebook Debugger – Bad Response Code: URL returned a bad HTTP response code : 404
I faced a issue with one of my clients sites after migration. The facebook debugger…
Jetpack not connecting 404 error
Check the url www.domain.com/xmlrpc.php and you should receive only “XML-RPC server accepts POST requests only.”…
Moneybird API Oauth Issue – Token Request
The example code in the moneybird API for oauth doesn’t give a clear picture of…
Bigcommerce WEBDAV tool
I had the opportunity to work in bigcommerce for one of the clients and i…