Where do I add sitemap.xml in the Laravel framework?


by drew , in category: SEO , 9 months ago

Where do I add sitemap.xml in the Laravel framework?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by elmo.conroy , 9 months ago


In Laravel, you can add your sitemap.xml file to the public directory of your project. The public directory is typically located at the root of your Laravel project, and it is the directory that serves as the do***ent root for your web server.

To add your sitemap.xml file, simply place it in the public directory alongside other public files such as index.php, .htaccess, and robots.txt.

Once you have added your sitemap.xml file, you should be able to access it at the following URL:


Note that you may need to update your robots.txt file to include a reference to your sitemap. You can do this by adding the following line to your robots.txt file:

Sitemap: http://your-domain.com/sitemap.xml

This will help search engines to find and index your sitemap more easily.