Redirect a website URL to another URL
Lets say you own "mydomain.com" and want visitors who go here to land on "theirdomain.com".
For a Gen7 VPS:
- Make sure DNS is set up and the website is using our nameservers
- Log in to your Dashboard
- Navigate to VPS HOSTING
- Select your VPS: yourvpsname.com
-> Click Manage (green button) - Go to the Web Sites
- Click Add New Website or Subdomain to this VPS (green button)
or if this is already complete, move on to the next step.
- Then in the public directory of that website (/home/domains/mydomain.com/public) add these lines of code in place of the contents within index.php:
<code><?php header("Location: https://theirdomain.com/"); ?>code>
Done! This allows us to safely redirect the traffic from one site to the other.
Note: You can do this on Gen6 VPS's as well, you just need to modify the directory to path to look like this:
<code>/home/domains/mydomain.com/docscode>