Hi all! We made a static website using Jekyll on Azure Static Webapp and faced a dilemma on how to properly set up different types of redirects necessary for SEO and not only.
Some of the main redirects that we need are:
Support Non-Trailing Slash Urls - redirect the Urls with / at the end to the url without it
Remove .html - by default the same pages on jekyll are accessible both with .html and without it, I would like to redirect pages with .html to the same url without it
Implement lower case url rule - so that when typing the url all the upper case letters would convert to the lower case by redirect
http errors - 404 page - by default Azure’s page is shown, I would like to show our own version of it.
Hopefully someone with direct Azure experience can chime in, but the Jekyll way to handle redirects is by using the jekyll-redirect-from plugin. That should cover your first three use-cases (if memory serves me right).
I prefer this solution as A) it allows you to port your full site to any host (Github Pages, Netlify, AWS S3, Cloudflare Pages, Vercel, etc) as the need arises - no vendor lock-in, and B) it keeps the site completely serverless - I use Jekyll specifically so I don’t have to monkey with any server settings.
As for the custom 404, most hosts I’ve seen honor a custom 404.md at root. So in root, you’d just add:
If you don’t hear from anyone on this forum with direct Azure experience in the next day or two, I’d suggest asking again on an Azure-centric forum. Among the big cloud providers, AWS S3 is somewhat popular in these parts, but I don’t recall anyone ever mentioning Azure.
Thank. I tried to install and set up the jekyll-redirect-from plugin, but it seems that it can redirect only specific url to another one. I didn’t find any general rules I’ve requested above or the opportunity to write complex logic. In the description it works like - set up the new url you’d like you current page to be redirected to. It seems that I have to search for the solution on server side. Anyway, thanks for the help!