CodeIgniter Forums
MAMP remove 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: MAMP remove index.php (/showthread.php?tid=38870)



MAMP remove index.php - El Forum - 02-22-2011

[eluser]Rick Blackdog[/eluser]
Hi, have read a few articles and tried various configs but am unable to remove index.php using my .htaccess file on my local machine (mac). This is a new install of MAMP running PHP 5.3 & apache 2.0.63.

My apache config has this line...
Code:
LoadModule rewrite_module modules/mod_rewrite.so

Here's my .htaccess file which is in the root directory (along with system & application).

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>

    ErrorDocument 404 /index.php
</IfModule>



MAMP remove index.php - El Forum - 02-22-2011

[eluser]duellsy[/eluser]
Might just be

Code:
RewriteBase /

If you have your project in a subfolder you'll need to specify it there e.g.,

Code:
RewriteBase /mysite/



MAMP remove index.php - El Forum - 02-22-2011

[eluser]Rick Blackdog[/eluser]
Damn, you're right.... thanks!


MAMP remove index.php - El Forum - 02-22-2011

[eluser]duellsy[/eluser]
awesome, go crazy!