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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

domain redirection

Status
Not open for further replies.

sickpuppy

Technical User
Feb 22, 2001
40
0
0
GB
I need to double check something with you all.

If I have my main site ( ) and also another domain name pointed to it ( is it possible to direct further into than the index page?

i.e. At present to get to our mini-site you go through the index page of this.com. Can be made to go straight to another directory -
I'm fairly confident that it can't but need evidence to show the MD.
 
Yes. Just change the URL in the redirect page.
For example, I have a redirect script, that also does a browser detect for different pages, one for IE, and one for Netscape/Other.

<script>

var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 4+
if (browser_type==&quot;Netscape&quot;&&browser_version>=4)
window.location.replace(&quot; to the Netscape page.&quot;)
//if IE 4+
else if (browser_type==&quot;Microsoft Internet Explorer&quot;&&browser_version>=4)
window.location.replace(&quot; to the IE page.&quot;)
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location=&quot; to the Netscape page.&quot;
</script>

This could be used for a redirect to ANY page, anywhere on the web, and is so fast, it's undetectable by most.

There are simpler redirects if you want to look at Cheers,
Jim
iamcan.gif
 
I'm not sure if Comtech's code is usefull for what you're trying to do...

It is called Piggybacking...

In order for this to work properly, you need to have this.com and that.com registered under the same IP Address.

once you do that...now both domains will default to the same site (or index.html).

By changing the structure of your site so that index.html contains: (and basic HTML code, as this page will not be seen by the visitor)

<script language=&quot;JavaScript&quot;><!--

if (location.hostname == &quot;this.com&quot;) window.location = &quot;this/index.html&quot;
if (location.hostname == &quot; window.location = &quot;this/index.html&quot;
if (location.hostname == &quot;that.com&quot;) window.location = &quot;that/index.html&quot;
if (location.hostname == &quot; window.location = &quot;that/index.html&quot;
// -->
</script>

and now in subfolders create new index.html pages for each site you need.
Note: Most hosting companies do not allow Piggybacking.

Good luck,
Pixel
 
Pixellpp

Thanks, that looks a lot more helpful.

Merry Christmas

Sickpuppy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top