getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Allow using dot "." in sitemap route #17

Closed martinsik closed 8 years ago

martinsik commented 8 years ago

Regular expression that checks valid sitemap route doesn't allow using "." characters so I can't use route like /sitemap.xml which is I think more common than /sitemap.

flaviocopes commented 8 years ago

You cannot have /sitemap.xml as the route. The route must be /sitemap, .xml is the page format, which is already xml. This means sitemap and sitemap.xml point to the same page.

If you want to deny access to sitemap and just allow sitemap.xml, you can do that via .htaccess, if you want.

danreb commented 8 years ago

@martinsik you don't need to put sitemap.xml in the route, it is already accessible in that URL. you can then just make the sitemap redirect to sitemap.xml in .htaccess using a very simple rule

Redirect 301 /sitemap /sitemap.xml

this is what i've done.

Regards, Danreb

martinsik commented 8 years ago

Thanks, I guess it's all right then. I didn't expect I can use both /sitemap and /sitemap.xml so I was confused when the validation didn't allow me to use /sitemap.xml.