squido logosquido blog

Netlify set customer headers

On some routes of your squido website, you may need to set certain headers for certain routes/URL's. For instance the /rss URL would need the Content-Type header set to application/xml.

Luckily services like Netlify this is easily done.

  1. Create a text file named _headers in the root of your /source directory
  2. In this file set the following:
/rss
  Content-Type: application/xml

The /rss is the route and Content-Type: application/xml is the header you want to set. You can adding multiple headers by adding a new line below Content-Type.

  1. You can then re-deploy your website on Netlify.
  2. You can then check verify using Postman:

Postman check

Thats it. You can read about more options on the Netlify website: https://docs.netlify.com/routing/headers/

Related posts