: Redirecting a subdomain to an HTTPS website I need to redirect a subdomain on my website to a third party HTTPS website. We have our website hosted on GoDaddy and I tried their subdomain forwarding
I need to redirect a subdomain on my website to a third party HTTPS website. We have our website hosted on GoDaddy and I tried their subdomain forwarding mechanism but that didn't work. That's when I created a seperate subdomain (which created a folder with that subdomain name) on my hosting. I then placed an HTML file with this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=https://third-party-domain.com">
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
But this didn't work. I then tried a .htaccess redirect using this:
Redirect 301 / third-party-domain.com
But this didn't work either. What am I doing wrong?
More posts by @Murphy175
1 Comments
Sorted by latest first Latest Oldest Best
Change the open body tag of your html to the following:
<body onload="window.location='https://third-party-domain.com';">
This will execute javascript to set the URL the window uses to the new URL provided. This won't work if javascript is disabled so you might want to include a link to the new URL. According to the W3C, the use of meta refresh to redirect users is discouraged because it's disorienting to the users.
If you have PHP, available on your host, simply replace the index file for the folder your subdomain points at with an index.php file containing only the following:
<?php
header('Location: third-party-domain.com', 301);
?>
This will send a 301 header to the user's browser and send them to the appropriate URL seamlessly.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.