How to replace index.php in your URLs
By default, Expression Engine URLs look like this:
http://yoursite.com/index.php/template_group/url_title
That index.php is pretty ugly, and will be part of every URL on your site. Fortunately, if your server supports it, you can replace it with something else. I prefer the word “home”. So now URLs look like this:
http://yoursite.com/home/template_group/url_title
In fact, URLs on EE Developer use this method. I have tried several methods to rename or even replace index.php. Some did not work reliably, but this method has worked on most servers I’ve tried. Note: if your server runs PHP over CGI, you may need to find another approach.
Keep in mind that your site will cease to function temporarily while you make these changes. This technique does not involve your database, so you do not need to back it up.
Step 1: Create a .htaccess file
Open a text editor like Notepad, and create a file with these exact lines:
DirectoryIndex home index.php index.html index.shtml index.htm
<Files home>
ForceType application/x-httpd-php
</Files>
If you’re on Windows, you’ll need to save it as simple htaccess (notice the lack of a leading dot), as Windows doesn’t like files with a leading dot. These shortlines of code do two things:
- Line 1: Tell the web server in what order to load files as the default. The first file in the line is “home”, so it will look for that first.
- Line 2: Force the server to treat the “home” file as php. Normally it would not, because “home” has no file extension.
Using FTP, Upload the .htaccess file to your web site root. While in FTP, rename index.php to home.
Step 2: Tell Expression Engine the new name of index.php
Go to Admin—> System Preferences—> General Configuration. For name of your site’s index page, enter the word home. You will also need to tell Expression Engine where your weblogs will point to. For example, your primary weblog may be here:
http://yoursite.com/home/main
Step 3: Rejoice!
If your server support this method, you should be able to view URLs with index.php replaced.
Bonus Tip
If you have an existing web site running on your web server that uses something other than index.php or home as its default file, you can develop your Expression Engine site without working in a development folder or subdomain. Simple reorder this line in your .htaccess file:
DirectoryIndex index.html home index.php index.shtml index.htm
Now you’ve told the server to load index.html as the default. That means when you go to:
http://yoursite.com
You’ll see http://yoursite.com/index.html
Meanwhile, your Expression Engine site lives at http://yoursite.com/home
Nifty!





