Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intelligent Redirect 1

Status
Not open for further replies.

terepan

Programmer
Oct 10, 2004
6
US
I have a client with a site I have maintained for a while at:
The client just bought another domain to attract another audience:

The client does not want to host a site at the second domain. They just want people to be directed to the first domain homepage. Like a mirrored site, but really a redirect.

I need to setup a script with an intelligent redirect on the homepage of the I thought I knew how to do it, but my hunches were wrong.

Any direction on how to go about setting this up is greatly appreciated.

Teresa
 
Teresa,

you should be able to set up this redirect at the dns level - your domain registrar most likely provides this service. rather than setting up nameservers for the domain, you just specify that traffic should redirect to another URL



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Thanks! I unfortunately do not have any access to CPanel. I just have FTP priviledges on this account.

Is the dns pretty much the way to go?

I did not think it through well initially.

Thanks for your help on this.

Healthy regards,

Teresa
 
it probably wouldn't be in cpanel, since it's something that's configured at the registrar. this is the only way (that i know of) to perform a redirect without hosting a redirect page on the second site.

some hosts however will allow you to point multiple domains to the same account, in effect "mirroring" the other domains. check with your host, as this must be done through the cpanel most likely and/or DNS settings

otherwise you'd have to host the second domain somewhere, and use a redirect page, a la

Code:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Strict//EN"
    "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en" lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    <meta http-equiv="refresh" content="0; url=[b][URL unfurl="true"]http://www.firstdomain.com/[/URL][/b]" />
    
    <title>redirect</title>
    <script type="text/javascript">
      location.href = "[b][URL unfurl="true"]http://www.firstdomain.com/[/URL][/b]";
    </script>

  </head>
  <body>
    <p>Click below if you are not automatically redirected:</p>
    <p>[b]<a href="[URL unfurl="true"]http://www.firstdomain.com/">[/URL]
      [URL unfurl="true"]http://www.firstdomain.com/</a>[/URL][/b]</p>
  </body>
</html>

there's a meta refresh as well as a javascript redirect for redundancy in case js or meta refreshes are disabled on the client browser, and a link if all else fails

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
HI Jeff!

Thanks! I appreciate the coding.

Teresa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top