Side Nav

Add Redirect code

As Go Web server is not using Apache and therefore not using the “. htaccess” file, you must do your own redirects in Go. I can think of three redirects. The first is to show a 404 page if the page not exists at all. The second is to redirect historically deleted pages. The third redirect to all static files like robots.txt.

In a separate Go file I put all the redirects, as it can grow to be rather big if you have cleaned your site and got many old paths.