Rewrite rule .htaccess for my sitemap.xml

Dominik picture Dominik · Sep 27, 2014 · Viewed 13.5k times · Source

I have a content management system plugin installed that provides a sitemap for Google under http://www.domain.com/index.php?eID=dd_googlesitemap how can I add a rewrite rule to my .htaccess that will make this sitemap available under http://www.domain.com/sitemap.xml instead?

Answer

Justin Iurman picture Justin Iurman · Sep 27, 2014

You can add this code to your htaccess file (which has to be in root folder)

RewriteEngine On
RewriteRule ^sitemap\.xml$ /index.php?eID=dd_googlesitemap [L]

Make sure mod_rewrite is enabled