Code Igniter URL Rewrite
According to Codeigniter Documentation following is the htaccess way to remove index.php from URI.
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
But unfortunately above is not working.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
According to Codeigniter Documentation following is the htaccess way to remove index.php from URI.
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
But unfortunately above is not working.
But Working htaccess is below.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Tags:
Codeigniter
Don't Forget to Change the index_page parameter in config File.
ReplyDeleteGo to Your Codeigniter Folder
application\config\config.php
Look for $config['index_page'] = 'index.php';
Change it to
$config['index_page'] = '';
If you are Using ABove code, then for Forms action, dont use server['php_self'], but use
ReplyDelete