How do I remove 'index.php' from URL in CodeIgniter? -
How can I remove index.php
from my code in CodeIgniter?
I deleted index.php
from my configuration file, and I have run my rewrite_module
in Apache (2.2.11) and my file is:
Revive Engines on Rewrite $ 1! ^ (Index.php | picture | cappa | css | js | robots \ .txt) revival ^ ^. (. *) $ / Index.ftp / 19 [l]
Now, Whenever I click a link, it indicates that the URL is not found. What's the problem
Try it in your file: Comments should help you get it ...
This works perfectly for me in many CodeIgniter website installations. Also, if mod_rewrite is not installed, it will send you to 404 page (or you can change it for your purpose).
& lt; Ifmodule mod_rewrite.c & gt; RewriteEngine OnRewriteBase / # 'System' can be changed if you have rename your system folder RewriteCond% {REQUEST_URI} ^ System * Rewrite ^ (. *) $ Index.php / $ 1 [L] # To check that the user is trying to access a valid file, #such as an image or CSS document, if this is not true Convert rewrite to index.php to #request% {REQUEST_FILENAME}! Sends! -FREVRATKOWN% {REQUEST_FILENAME}! -d # This final condition enables access to images and CSS folders, and robots.txt file RewriteCond $ 1! ^ (Index.php | (*. *) \ .swf | picture | robot \ .txt | css | docs | cache] ^ ^ ^ ^ ^ ^ () * $ Index.php / $ 1 [L] & lt; / IfModule & gt; & Lt; IfModule! Mod_rewrite.c & gt; #If we do not have mod_rewrite installed, then all 404 can be sent to # index.php, and everything works as normal. ErrorDocument 404 /application/errors/404.php & lt; / IfModule & gt;
Check your virtual host file and see if you have these items set - they can allow your .htaccess file to be written correctly:
< Pre> option FollowSymLinks Allow all cancellation orders, Allow denial of all
Comments
Post a Comment