Kevin Phillips is a web developer for Devol and LiveHost WebHosting
Codeigniter 2 Pretty URLs
Submitted by kevin on Fri, 06/10/2011 - 09:14
To change Codigniters default setting for urls which current shows http://www.domain.com/index.php to pretty urls like http://www.domain.co.nz/page/contact you need to do two things.
Firstly in the application/config/config.php on line 33 change
$config['index_page'] = 'index.php'; to $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]
Add new comment