If you ever faced this issue in the dynamic sitemap generated?
The error says Incorrect http header content-type: "application/json;charset=UTF-8" (expected: "application/xml")
This issue was caused by not setting the header content type properly. By default HTML page will return the text/html content type. In my case it was
| content-type | application/xhtml+xml |
you can verify this network tab in chrome and firefox,
@RequestMapping(value = "/sitemap.xml",method = RequestMethod.GET,
produces = MediaType.APPLICATION_XML_VALUE)
Then it should work properly. Verify it in chrome or firefox before submitting it to google again.
This worked :)




No comments:
Post a Comment