Tuesday, October 29, 2013

Removing url/index.php/... when using CodeIgniter

When creating application using CodeIgniter by default the URL will be as follow:

http://www.mydomain.com/index.php/home

When you want to shown as

http://www.mydomain.com/home



Solution

Put a file .htaccess in your root application folder

The file .htaccess content is

RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /your-root-folder/index.php/$1 [L]




No comments: