Joomla allows duplicate content for your home page. For example, if a user enters either http://mysite.com or http://mysite.com/index.php, both URLs show the home page. Google sees this as duplicate content. It’s best to redirect /index.php to /.
How to Redirect index.php to / for Joomla Home Page:
In order to use this procedure, you need to turn on Joomla SEF URLs.
- Using FTP or your cPanel File Manager, download the .htaccess file from the root of your Joomla installation. This is usually in the public_html folder on your web server.
- Add a new line below RewriteEngine Onand insert the following text:IMPORTANT: In the code below, change mysite.com to your domain name.
########## Begin - Redirect index.php to / ## Note: Change example.com to reflect your own domain name RewriteCond %{THE_REQUEST} !^POST RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$ RewriteRule ^index\.php$ http%2://mysite.com/$1 [R=301,L] ## If the above line throws a 500 error, change [R=301,L] to [R,L] ########## End - Redirect index.php to /
- Save .htaccess and use FTP to upload it to the Joomla root folder, usually public_html
- To test the code, enter http://mysite.com/index.php where mysite.com is your domain name. Your browser should automatically redirect the URL to http://mysite.com
Tomasz says
Works perfectly! I recommend it!
Tomek
darseo says
I have problem with redirect, maybe this will be good ;)