CodeIgniter Tutorial - How to Remove index.php

Copy the following code and create a .htaccess file. Save the file inside your project folder.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /replace this with your base url
  RewriteCond %{REQUEST_URI} ^system.*
  RewriteRule ^(.*)$ /index.php/$1 [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(index\.php|images|robots\.txt|css)
  RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  ErrorDocument 404 /index.php
</IfModule>



Previous
Next Post »
0 Komentar