Codeigniter 2 Pretty URLs

To change Codigniters default setting for urls which current shows to pretty urls like you need to do two things.

Firstly in the application/config/config.php on line 33 change

$config['index_page'] = 'index.php';
$config['index_page'] = '';

  And in the same directory as your main index.php file add a new file .htaccess and add this code

RewriteEngine On
RewriteCond $1 !^(index.php|images|captcha|css|js|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments

Copywrite © 2018 Kevin Phillips All rights are reserved.

Proudly supporting opensource software