You could look at generating the site map on the fly in response to a request?
So have a route for {language}/sitemap.xml that streams the map as a view.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i have a site example.com with multi language so it redirect to example.com/ar , example.com/en and so on. the problem is i want to put site map file for every language like that example.com/ar/sitemap.xml ,
example.com/en/sitemap.xml but i havent folder named ar and en when i creat folder ar and put site map file in it
google approved but my site gives me 403 error forbidden and cant redirect to example.com/ar because the folder
has only site map file. now do i have to put a copy of public folder into every language folder beside site map file
tahnks.
You could look at generating the site map on the fly in response to a request?
So have a route for {language}/sitemap.xml that streams the map as a view.
Please or to participate in this conversation.