Netlify hosting and redirects

07 Jan, 2023

Did you know that Netlify allows for you to have a configuration file to tell it how to deploy your project?

There is a special netlify.toml file that can be used for many settings you can configure when deploying your site. I want to focus on the redirects in this post specifically.

When building a site Netlify gives you a domain. This is useful for a single app where you dont need a custom domain attached.

I recently moved to Netlify for hosting instead of GitHub Pages to publish my Jekyll site. the setup and move was easy to do too. I did get my subdomain initally, but you can change that. So I changed mine to to match some of the other naming schemes of other items.

I found this post on Moving your Jekyll site to Netfify, and Netlify makes this easy as well straight from your dashboard when making a new project with them.

Once the site was built, I could go to and (once DNS was update), but just like forwards to the APEX domain, I wanted the * to auto redirect which it does not from the website configurations.

Thus comes in the redirects:

  from = ""
  to = ""
  status = 301
  force = true

Pretty simple right? Now there is another option. To add a _redirects file, and with Jekyll we need to include this in our _config.yml file for building.

This syntax is pretty simple as well.

# Redirects from what the browser requests to what we serve
/home              /
/blog/my-post.php  /blog/my-post
/news              /blog

When you hit /home we want to redirect that to the root of the domain /. This redirect could be realated to how a .htaccess file works as well for redirects.

As mentioned earlier, there are plenty of config options you can use with the netlify.toml file.

I'm publishing this as part of 100 Days To Offload. You can join in yourself by visiting

Tags: netlify, web design, 100DaysToOffload


If there are replies, they will show below.

Found an issue? Edit on Github

← Back home