I am trying to remove index.php from my URLs on my local WAMP server using the supported .htaccess code:
<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
I went into General Configuration and removed "index.php" from "Name of your site's index page" and saved. I am running EE on a subdirectory (http://localhost:8080/mysite/), so I removed the "/" before "index.php" in the last line:
RewriteRule ^(.*)$ index.php/$1 [L]
It works for the home page, but for the rest pages when I click the links (which now have the index.php removed), I get this error:
Not Found
The requested URL /mysite/about-us was not found on this server.
I am still able to access the about-us page at /mysite/index.php/about-us.
Can someone please help me?
<IfModule mod_rewrite.c>
lines, they are a waste of space and only hide potential problems. Try usingRewriteRule ^(.*)$ index.php?/$1 [L]
instead?