Codeigniter default htaccess file

Codeigniter default htaccess file – Best solution For SEO

codeigniter default htaccess

This codeigniter default htaccess file will remove index.php part from your web urls and also this will be a simple htaccess file which will only rewrite the urls. How ever to use this file mod-rewrite should be enabled form the Apache config file and this codeigniter default htaccess file will also minimize 404-errors from your website. So you should put this in to your root folder.



Click the below link to download the htaccess file

Download Code Igniter Default htaccess File

 

  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]



  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin

  ErrorDocument 404 /index.php

You also have to check the file permission in the folder.If your folder cannot read by the web user you will not able to see the rewrite changes and some times you might get errors. So before changing the file again and again please check the folder and file permission.

If you find this post is helpful please leave a comment below.

More Helpful Information

Leave a Reply

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

12 − 2 =

20 − 12 =