Magento SEO /index.php re writes
Magento is a great eCommerce platform and one that we spend most of our time working with and using. Out of the box it offers many SEO features however one area that requires some attention is the response that Google (and other search engines) get from your index.php / index.html (and other file extensions).
To be completely safe, a 200 response should only be returned by one of your ‘Home’ pages, the others should return a 404 (file not found) or 301 (permanent redirect).
Anything else could be a potential duplicate content problem – which is a major head ache for SEO with eCommerce stores.
For example – out of the box Magento can respond with five (or more) 302’s:
http://domain.com returns a 302 (temporary) redirect
http://www.domain.com returns a 200 (OK) response. PR N/A
http://domain.com/index.php returns a 302 (temporary) redirect
http://www.domain.com/index.php returns a 302 (temporary) redirect
http://domain.com/index.html returns a 302 (temporary) redirect
http://www.domain.com/index.html returns a 302 (temporary) redirect
You can check your site using one of the online tool like http://www.ragepank.com/redirect-check/ – just enter your domain and it will show your results.
Whilst a 302 isn’t to bad – its a temporary redirect – a 301 would be much better!
What you want is the .php and .html URLs to redirect to the ‘Root’ domain – in the below case http://www.domain.com, like this:
http://domain.com returns a 302 (temporary) redirect
http://www.domain.com returns a 200 (OK) response. PR N/A
http://domain.com/index.php returns a 301 (permanent) redirect
http://www.domain.com/index.php returns a 301 (permanent) redirect
http://domain.com/index.html returns a 301 (permanent) redirect
http://www.domain.com/index.html returns a 301 (permanent) redirect
Now Google (and other search engines) understand that you have one home page and will be directed to it.
To make this happen you need to make some changes to your ‘htaccess’ file – so make sure you have a full back up of your websites, Database and File BEFORE making any changes – and make sure you understand how to edit / save and restore any changes that you make.
Step 1) Make a copy of your current .htacess file that is in your website root and put this into the /downloader/ directory. This is needed else Magento connect will have issues when you try and install new extensions.
Step 2) Open the .htaccess file found in your website root and look for this line:
Options +FollowSymLinks
RewriteEngine on
Below this add:
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.your-domain-name.com/$1 [R=301,L]
Redirect 301 /index.html http://www.your-domain-name.com/
Replacing ‘your-domain-name.com’ with your real domain.
Step 3) Save and test the front end, back end and Magento connect works as expected, If not just remove these changes and re save the file.
Step 4) If its all working as expected you can now head back to http://www.ragepank.com/redirect-check/ and re check your results.
As with all SEO actions ensure that you check this with your SEO consultant before applying them.
We hope that you found this helpful, and if you want more direct one to one advice we offer a range of eCommerce services to suit, please get in contact