Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Tuesday, August 3rd at 3pm PST / 6pm EST. Learn more
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pwaddles
New

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
Heather
Employee

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
samiam
New

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.