<p>The default '.htaccess' file that comes with craft should not 'block' or redirect any files that exist; it simply routes what would otherwise be 404 requests (i.e. documents that don't exist) to craft, so that craft can attempt to resolve the route. </p>

<p>If your sitemap is a static file, then the correct location would be in your public folder. If you are receiving an error trying to access it, then something else is going on with your site (possibly from a modified '.htaccess' file, or apache configuration).</p>

<p>If generating your sitemap dynamically via a craft twig template or plugin, then your sitemap template would likely be in your templates folder. If you are receiving a 404 response then the route to the sitemap has not been properly configured in craft (in your section, plugin, or routes settings depending on how you are defining it).</p>

CC BY-SA 3.0
2015-02-28T11:35:48.093Z
2015-02-28T13:49:10.340Z
2015-02-28T13:49:10.340Z
Douglas McDonald
<p>I've attempted to add an xml sitemap within the /public directory but received a 404 because htaccess is blocking the document. What is the proper location and method to add an xml sitemap to Craft? </p>

CC BY-SA 3.0
2015-02-28T01:57:07.973Z
What is a "wow"?
Anna_MediaGirl
CC BY-SA 3.0
2015-02-28T03:38:24.787Z
Sorry I meant 404
Zach Shallbetter
CC BY-SA 3.0
2015-02-28T04:28:49.447Z
Please add more information to your question... How did you confirmed it was htaccess blocking the xml file load? What are the contents of your htaccess file? What part of the htaccess code is causing the 404?
Anna_MediaGirl
<siteurl><analytics>
Adding XML Sitemaps
# Adding XML Sitemaps

(Asked by: username_0 on 2015-02-28)

I've attempted to add an xml sitemap within the /public directory but received a 404 because htaccess is blocking the document. What is the proper location and method to add an xml sitemap to Craft?

**Tags:** siteurl, analytics
> **Comments:**
> **username_1**: What is a "wow"?  
> **username_0**: Sorry I meant 404  
> **username_1**: Please add more information to your question... How did you confirmed it was htaccess blocking the xml file load? What are the contents of your htaccess file? What part of the htaccess code is causing the 404?  

---

## 1 answers

### Answer by username_2 on 2015-02-28. Score: 3

The default '.htaccess' file that comes with craft should not 'block' or redirect any files that exist; it simply routes what would otherwise be 404 requests (i.e. documents that don't exist) to craft, so that craft can attempt to resolve the route.

If your sitemap is a static file, then the correct location would be in your public folder. If you are receiving an error trying to access it, then something else is going on with your site (possibly from a modified '.htaccess' file, or apache configuration).

If generating your sitemap dynamically via a craft twig template or plugin, then your sitemap template would likely be in your templates folder. If you are receiving a 404 response then the route to the sitemap has not been properly configured in craft (in your section, plugin, or routes settings depending on how you are defining it).


---

