Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jakubjv's avatar

What is correct way adding sitemap.xml into laravel app?

Hello, I've app in production which is available on the internet already and running on shared hosting. I generated sitemap.xml for that website with generator on the web. Where should I place this file? Should I make any route in web.php for that? Cause google is telling me that sitemap.xml is not found and giving me 404 error.. I'm sorry maybe is it stupid question but I am novice in this, what is best practice for stuff like this ? Thanks for advice! :)

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

Place the sitemap.xml file in your public directory

1 like

Please or to participate in this conversation.