3

I have a template_group/template like sitemap/index.php, in which I have a regular html site map for site visitors. I also have sitemap.xml in the root folder.

visiting www.site.com/sitemap is showing the sitemap.xml file and not the one I have in sitemap/index.php.

I'm using the EL supplied htacccess file to remove index.php from url's.

Be grateful for any suggestions on how to fix this please.

Best wishes Lee

3 Answers 3

1

I would move your sitemap.xml file to an EE template make sure you choose xml as the template type. Then remove your sitemap.xml from the root.

YOu can update your xml sitemap url in google webmasters tool and set up an .htaccess 301 redirect to ensure there are no problems with the move.

1

If you ensure that the forward slash is appended to www.site.com/sitemap/ this will tell EE that it is a directory rather than a file and it will go hunting for the index.php file in that directory.

You can also try to specifically set the headers for XML files in the .htaccess file to be sure:

# Set encoding for file extensions
<IfModule mod_mime.c>
  AddType application/xml .xml
  AddType text/xml .xml .xsl .xsf .xsd
</IfModule>
1

Thanks for the answers guy's! In the end i went super simple and just renamed my xml file to site-map.xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.