There are many different ways to redirect a visitor from one URL to another. I prefer the PHP redirect. Let’s say for example you are an affiliate for a new online store and they have given you a unique affiliate link to post on your blog to track the referrals you generate. Most of the time, this link it pretty ugly. You may want to have a URL that looks more professional or perhaps easier for someone to type or remember. You can redirect visitors from the pretty URL to the actual affiliate link instantly and still receive credit for the referral.
Like I said, there are many ways to do this, here is one…
Execute a PHP 301 Permanent Redirect
- Create an empty PHP file. e.g. redirect.php
- Copy the code below and paste it within the file.
- Make sure there are no spaces or other characers before the first
- Save. & upload.
header("HTTP/1.1 301 Moved Permanently");