Redirect to Another Web Page

When I was thinking about this post, I thought it would be very short and straightforward. However, it looks like there are at least 3 different ways with pros and significant pitfalls.

In general, there are 3 ways you can make a redirect.

HTML meta

<meta http-equiv="refresh" content="5; url =" />


<script type="text/javascript">
    window.location.href = "" 

Server-side redirects

# Apache
Redirect 301 /
RedirectMatch 301 /blog(.*)$1
Redirect 301 /page.html http://www.old-website/new-page.html

So if you’d like to know their differences and decide which one to use and when then I hope you enjoy this video.

Source code and references:

If you want to support me

Follow me on Youtube or GitHub if you want me to continue.