cancel
Showing results for 
Search instead for 
Did you mean: 

Forwarding subdomain of Domain A to subdomain of Domain B

Hi there,

 

I have a business with a long URL, lets call it reallylongandhardtotypeonaphone.com.  All of my customer sites get a new subdomain of this e.g. customer1.reallylongandhardtotypeonaphone.com.

 

I've recently purchased a much shorter URL, lets call it short.co.nz.  I'd like to dynamically forward routes to any subdomain of short.co.nz to the longer URL without having to setup DNS or forwarding entries for all subdomains.

 

Does this make sense, and is this achievable?

 

Essentially I want a user to be able to browse to customerX.short.co.nz/index.html and be redirected to customerX.reallylongandhardtotypeonaphone.com/index.html

 

Many thanks in advance,

 

Hadley

2 REPLIES 2
Highlighted
Employee
Employee

Re: Forwarding subdomain of Domain A to subdomain of Domain B

Hello @pwaddles!

 

Thank you for posting. You could probably use domain forwarding for this. Though, you would need to set each forward up individually, as far as I know. 

 

Heather - GoDaddy | Community Moderator
24/7 support available at x.co/247support
New

Re: Forwarding subdomain of Domain A to subdomain of Domain B

Here’s a standard script to redirect to a fixed domain:

 

<?php
$url =
"https://reallylongandhardtotypeonaphone.com";
header("Location: $url");
?>
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META http-equiv="Refresh" content="0;url=<?php print $url; ?>">
<TITLE>Sam Trenholme tweet redir</TITLE></HEAD><BODY>

This web page should go to the link.
If not, <A href="<?php print $url; ?>">go here</A>.
</BODY></HTML>

If we just have every single subdomain of short.co.nz go here, we can make the above file be index.php, and make sure the web server is configured to have all of the subdomains of short.co.nz use a document root with the above file as index.php.