CodeIgniter SEO

How to write SEO friendly urls in CodeIgniter

Hi, In this post i will going to explain about How to write SEO friendly urls in CodeIgniter using .htacess file.

How to write SEO friendly urls in CodeIgniter by Anil Kumar Panigrahi
How to write SEO friendly urls in CodeIgniter by Anil Kumar Panigrahi

create  .htaccess file with the following contents.

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

Then url will be

http://localhost/codeIgniter/[controller-name]/[method-name] /

 
It will be useful.

Thank you

7 thoughts on “How to write SEO friendly urls in CodeIgniter”

  1. hi, I tried but i couldn’t make this as work..can you send me more information about this. just like whare am i put this .htaccess file? whin i put this on root in host public directory it generated sever error

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.