CodeIgniter Forums
index.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: index.php (/showthread.php?tid=54443)



index.php - El Forum - 09-08-2012

[eluser]Captain_Fluffy_Pants[/eluser]
what is the right way of removing the index.php from urls?


index.php - El Forum - 09-08-2012

[eluser]solid9[/eluser]
edit the .htaccess

and try these codes,
Code:
<IfModule mod_rewrite.c>

    Options +FollowSymLinks
    RewriteEngine on

    # NOTICE: If you get a 404 play with combinations of the following commented out lines
    #AllowOverride All
    #RewriteBase /yourbase

        RewriteCond $1 !^(index\.php|images|robots\.txt)

    # Send request via index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    <IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>

</IfModule>