How to set up a redirect on your website

There are two main reasons most people want to set up a redirect:

  1. To redirect a page after changing the URL (so existing links to the old URL don’t break)
  2. To create an ‘easy’ link to an outside profile (like setting yourwebsite.com/spacehey to redirect to your SpaceHey profile).

It’s really simple to do! I’ll lay things out, but if you just want the code you can scroll to the bottom!

I used to put all of my internet stuff at https://sadgrl.online/cybercafe/, but then I changed the name of the older to cyberspace, so the link changed to https://sadgrl.online/cyberspace/. I didn’t want to break any links to my site for anyone still using the URL, so I made a redirect.

First, I needed to recreate a folder called cybercafe and place an index.html file in it.

Then, I needed to delete everything inside of the file so it’s completely blank.

Finally, I needed to paste this code, which handles the redirect:

<meta http-equiv="Refresh" content="0; url='/cyberspace/'" />
Code language: HTML, XML (xml)

In the part that says url= between the apostrophes is the new path to my page. Since I’m starting it with a forward slash (/), it means it will point to https://mywebsite.com/cyberspace (even though we left out the https stuff).

You can also include a fully qualified URL here (beginning with https…) to another page, like a profile on an external website.



Hey, thanks for reading! If you have any questions, you can leave me a comment and I always try to reply.

If you have any suggestions on how I can improve this article, please let me know!

This website is not monetized in any way. It purely exists to help others on their web-building journey. However, if you have the means to donate toward my server costs, I have a ko-fi account where I accept tips.

Leave a Comment