Remarkably simple problem I have that I'm not finding a simple solution for.
Essentially I have a duplicate url issue with a Magento site's home page.
I have in the url structure the below:
www.domain.com
but also:
www.domain.com/home
Which essentially point to the same page.
I want to remove the latter url which has /home at the end.
I can't simply disable the CMS page that is the home page, as the home page then loads without the home page content in there.
All I want to do is essentially remove the /home from my sitemap generation and from Google's search index.
I still need the main url www.domain.com to index and be found though.
I'm finding that Google is not indexing my main url properly because of the duplication.
I would have thought there would be a basic setting in Magento admin to prevent this? Thanks for any help as always.
Best Answer
How to remove
home
identifier from the homepage url inside the generated sitemap.(Tested on CE 1.9.3.4)
Before:
<loc>http://www.example.com/home</loc>
After:
<loc>http://www.example.com/</loc>
Copy your Sitemap.php from:
to:
Look for:
and REPLACE IT with:
then copy Page.php file from:
to:
and open this too. Look for:
and REPLACE IT with:
Go to the backend, generate a brand new sitemap and Bob's your uncle! :D