diff options
Diffstat (limited to 'content/blog/2021-10-09-apache-redirect.org')
| -rw-r--r-- | content/blog/2021-10-09-apache-redirect.org | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/content/blog/2021-10-09-apache-redirect.org b/content/blog/2021-10-09-apache-redirect.org index c1de6be..6160882 100644 --- a/content/blog/2021-10-09-apache-redirect.org +++ b/content/blog/2021-10-09-apache-redirect.org @@ -5,15 +5,13 @@ * The Problem -After recently switching static site generators (SSG), my blog URLs -changed with no option to preserve the classic =.html= extension at the -end of my blog post URLs. +After recently switching static site generators (SSG), my blog URLs (uniform +resource locators) changed with no option to preserve the classic =.html= +extension at the end of my blog post URLs. -I really disliked using my old SSG ([[https://jekyllrb.com][Jekyll]]) -and prefer my new tool ([[https://www.getzola.org][Zola]]) much more, so -I was determined to figure out a way to get the proper redirect set up -so that people who find my posts online aren't constantly met by 404 -errors. +I really disliked using my old SSG ([[https://jekyllrb.com][Jekyll]]) and prefer my new tool ([[https://www.getzola.org][Zola]]) much +more, so I was determined to figure out a way to get the proper redirect set up +so that people who find my posts online aren't constantly met by 404 errors. * The Solution @@ -21,11 +19,10 @@ To solve this problem, I really needed to solve two pieces: 1. Redirect all blog post URL requests from =/blog/some-post.html= to =/blog/some-post/=. -2. Ensure that no other =.html= files are redirected, such as - =index.html=. +2. Ensure that no other =.html= files are redirected, such as =index.html=. -After /a lot/ of tweaking and testing, I believe I have finally found -the solution. The solution is shown below. +After /a lot/ of tweaking and testing, I believe I have finally found the +solution. The solution is shown below. #+begin_src conf RewriteEngine On @@ -38,8 +35,8 @@ following: 1. Turn on the RewriteEngine so that we can modify URLs. 2. Ignore any =index.html= files from the rule we are about to specify. -3. Find any =.html= files within the website directory and redirect it - to exclude the file extension. -4. The final piece is adding the trailing slash (=/=) at the end of the - URL - you'll notice that I don't have an Apache rule for that since - Apache handles that automatically. +3. Find any =.html= files within the website directory and redirect it to + exclude the file extension. +4. The final piece is adding the trailing slash (=/=) at the end of the URL - + you'll notice that I don't have an Apache rule for that since Apache handles + that automatically. |
