Fully Removing index.php From URLs


We recently updated our user guide’s article on removing index.php from URLs, and it includes a pretty important change worth noting here.

Previously, the rewrite instructions in the guide allowed ExpressionEngine to run properly when index.php was left out of URLs. ExpressionEngine URLs looked like this by default:


But the rewrite instructions allowed ExpressionEngine to serve up that same page when the browser was pointed here:


Awesome, right? The problem was that the URL with index.php in it still worked, meaning ExpressionEngine would serve the same page for two different URLs. That might seem pretty harmless, but duplicate content can have a negative effect on your site’s search engine rankings. And if some visitors are browsing your site with URLs that include index.php and some aren’t, the site’s analytics could become much less meaningful.

The rewrite instructions now include a rule to actually remove the index.php from URLs if it’s present. That leaves you with clean, index.php-free URLs every time.

We strongly encourage you to update your site’s .htaccess file with the latest rewrite instructions.

Comments & Feedback

  1. We’ve been doing this for a while, but thanks for adding it to the official docs. You might also want to include the optional rewrite for removing the default template group and the default templates (index) in each group.

    Picture of Paul @ Westhouse IT

    Paul @ Westhouse IT

  2. How about a simple article on removing template groups. I have read them on other sites and of course I understand the EE approach. But sometimes it is just nice to simply get a site running quickly, the way WordPress allows. If only… lol. Anyways, would be good to see what EL thinks the best way to go, along with menu building…without various plugins. Actually,w ould be nice if we could just toggle in the admin ‘Rewrite index.php’, ‘Suppress template in URLs’

    Picture of DevServe


  3. DevServe, you’re correct that removing template groups is a bit against the grain in terms of how ExpressionEngine works, so we’re not likely to write an article that encourages working against the software. Thank you for the suggestions in any case, it’s nice to hear what types of things people would like to see.

    Picture of Derek Jones

    Derek Jones

You must be logged in to comment on this blog post