I want to access my URL\'s without index.php
in CodeIgniter. Here is my Blog
controller
class Blog extends CI_Controller {
pub
To remove index.php
create a .htaccess
file in the same folder as your site’s main index.php file.
Then add the following code to this newly created .htaccess file:
RewriteEngine On
RewriteBase /
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
this code have two parts
1 - remove index.php
2 - redirect all site requests to the index file.