I spent hours trying to figure this out and thought I would write about the solution. When turning on Search Engine Friendly URL’s in Joomla, they begin adding an extra index.php within the URL’s so that it looks something like this – http://www.yoursite.com/index.php/category/article.
I want the URL to be http://www.yoursite.com/category/article.
It’s cleaner and better for the search engines.
So, here are the steps I took to remove the unnecessary index.php:
- Go to the Global Configuration area within your Joomla admin.
- Under SEO Settings, click YES for the following two items:
- Search Engine Friendly URLs
- Use Apache mod_rewrite (update: In Joomla! 2.5.7, Erik’s step 2. 2. should be “Use URL rewriting”. There is an exclamation icon next to this option. Hover over it to see important instructions like changing the htaccess before clicking on Yes and saving. Thanks Shane Brenizer
- Now, go to your htaccess.txt file at the root of your site and rename the file .htaccess.
- Use some sort of text editor (I use text wrangler) to remove the ‘#’ before the words ‘RewriteBase / (update: In Joomla! 3.0, you don’t need to take off the ‘#’ sign from htaccess. Just rename the htaccess.txt file to ‘.htaccess’ Thanks Raihan)
- For me, this was around line 53 of the .htaccess file.
- Now, try to navigate around your Joomla website. The index.php should be gone.
Blog photo by Needoptic