My CodeIgniter .Htaccess

Htaccess
This is my .htaccess file

RewriteEngine on
RewriteCond $1 !^(index\.php|images|user_guide|assets|captcha|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

It should be placed in root of the website. Rewrite module of apache should be enabled or it will give you an 500 internal server error.

With this you can skip index.php in URL. Also some folders like images, assets you don’t want redirection. This file does all this. Short and sweet.

Tested on wamp 2.0i with codeigniter 1.7.2

Let me know your CSS.

Category(s): Featured, Newbie, PHP

One Response to My CodeIgniter .Htaccess

  1. Thank you for sharing with us.

Leave a Reply

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

*

 

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">