Using 301 redirects in .htaccess to migrate away from /index.php

The default re-write method for sh404SEF® is index.php mode. This will insert add /index.php into all of your URLs. For example:

http://domain.com/index.php/article-title.htm

Similarly, index.php? may also be used on some sites (such as on Windows servers).

Occasionally, users may wish to migrate from these re-write modes to mod_rewrite. mod_rewrite produces the most human-readable and generally the most desired URLs for page ranking in search engines such as this:

http://domain.com/article-title.html

The problem with migrating an existing site from index.php mode to mod_rewrite mode is that all of the existing URLs that have been indexed by Google contain index.php. Suddenly removing the index.php from your URLs will likely have negative consequences on your page ranking.

The best way then to migrate your URLs while retaining page rank is to create a series of 301 redirects in your .htaccess file to link the existing index.php-containing URLs to the new index.php-free URLs. For small sites, you could manually do this with an entry in the .htaccess file for each URL.

For large sites however, this is not practical. We have prepared experimental additions to the standard .htaccess file supplied with Joomla that, in most cases, will automatically create 301 redirects from the existing index.php-containing URLs to the new index.php-free URLs. For more details, please visit the relevant area of the sh404SEF® User Manual.

 

 
 

Get the latest updates on our extensions