Answer the question
In order to leave comments, you need to log in
How to change the Content-Type header in laravel when displaying a sitemap?
The site has it. sitemap
It consists of a индекса Sitemap
lot of files with a list of links (each file has 50k links).
The sitemap index is placed in the public folder.
Accessing index by link: example.com/sitemap.xml
Accessing other files:
- example.com/sitemap/sitemap1.xml
- example.com/sitemap/sitemap2.xml
The file opens, but in the response header Content-Type: application/xml
.
I need to change the Content-Type to a different response.
Can you tell me how to implement?
If I generated using laravel sitemap, then there would be no problems. Simply in Response registered the necessary heading.
But you need a direct link to display the sitemap index file and files with a list of links. How can the Content-Type be changed in this case?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question