Using .htaccess for permanent redirects

I have been running an older version of Ground School that was based on WordPress at for some time now. I kept both applications running simultaneously to give users a chance to move over to Ground School on their own time, but software doesn’t die easily. Even with the massive improvements to UX and performance in Ground School which is a .NET Core application, compared to the old WordPress-based plugin mess of an application, some users still kept using because they were comfortable with how it worked.

Unfortunately, it wasn’t possible to maintain two applications anymore, especially considering they are written in two different programming languages, and when updating WordPress, often plugins have issues updating or something changes which breaks things. Therefore was not been maintained as well as Ground School – it was just kept running well-enough so that it was usable. Eventually though, due to security and time-requirements, I had to make the decision to shut it down for good.

Now came the problem of redirecting users to the new site at As I do not have much experience managing Apache servers, I found this part to be a bit tricky, as using just a normal redirect meant that any additions to the URL such as /shop or ?postId=xxx also stayed on the URL when redirecting. I wanted all URLs that point to to redirect to Eventually I figured out what I needed to do.

I had to create a .htaccess file in the root directory of the webserver (the public_html directory) and then add the following lines to this file.

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule .* [R=301,L]

If you got here because you need to do the same thing and this file already exists for you, then add these lines to the top of the file, also replace the with your URL.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.