Click to See Complete Forum and Search --> : Redircting a url


Joebscripting
06-12-2006, 12:35 PM
I am completely new to this stuff, and have a real problem. A client had a website (completely flash and done by someone else). They also had another domain name pointing to the same dns server but not being hosted (they are only paying for hosting for the first domain). There was a sub-folder on their site with web pages for the second domain. Somehow, the previous people who had done the sites had done a redirect so that if you typed the second domain name into your browser it would open those web pages, yet only show the second domain in the address bar (that is, it would not show it as a sub-directory of the main domain).

I was asked to re-write the main site in html. I then downloaded and saved the original folders from the site, deleted them from the server and uploaded all my pages (but kept the sub-folder with the second sites web pages on the server). Now when I type the second domain name into a browser it goes to the main site pages instead, but still shows the second domain name in the address bar, and as a browse the main sites pages the second domain name stays in the address bar rather than the main domain name.

The hosting company isn't any help except to say they figure the original site managers wrote an asp file that originally made the second domain name automatically go to the second domains pages in the subfolder. So I uploaded all of the asp files I had taken off the site but it hasn't restored things so that typing the second domain name into a browser will automatically go to the subfolder with its pages. It still goes to the main site.

Can anyone help me with how to make this work the way it did before? I'm posting this here simply because the hosting people said it was likely an asp thing. And because they don't consider it a hosting issue they want to charge $75.00 per hour to "look into it".

Any and all help would be much appreciated. I know nothing about asp, so if anyone can provide me with a redirect file or javascript that would allow one to type the second domain into a browser, keep that name in the browser and access the subfolder I would sure appreciate it.

Regards,

JoeB

russell
06-12-2006, 01:11 PM
Search through the ASP for the following strings:

Request.ServerVariables("url")
Request.ServerVariables("HTTP_HOST")
Request.ServerVariables("LOCAL_ADDR")
Server.Execute
Server.Transfer

When you find 'em, you'll need to examine the code. It's easy in ASP to do what they've done, but there are several ways to do it, so it'll take a little hunting. If/When you find anything, post back for more specifcs

Joebscripting
06-12-2006, 03:39 PM
Search through the ASP for the following strings:

Request.ServerVariables("url")
Request.ServerVariables("HTTP_HOST")
Request.ServerVariables("LOCAL_ADDR")
Server.Execute
Server.Transfer

When you find 'em, you'll need to examine the code. It's easy in ASP to do what they've done, but there are several ways to do it, so it'll take a little hunting. If/When you find anything, post back for more specifcs
------------
There were a bunch of .asp files, and I searched them with Homesite's extended find for all and just parts of the code you posted and found nothing, I'm afraid. However, I found a snippet of javascript code that seems to do the trick. There is no need to read any further, but as I'd already written the full explanation of my situation and what was happening just before I found the code, I'll leave it attached below just in case you want to read it or have other resources a guy might want to experiment with.

And thanks for your prompt reply!

Here's the situation, wordy and in-depth:

If you type either http://www.maindomain.com or http://www.seconddomain.com into IE you end up on the main domain's intro page, with the index.html and other html pages on the public root and a bunch of folders containing elements.

One of the folders, however, is named seconddomain. Inside that folder is another index.html file with the seconddomain home page, as well as sub-folders with the elements for that page.

Now, if you type http://www.maindomain.com/seconddomain into IE it goes to the seconddomain pages keeping the same url you typed. If you type http://www.seconddomain.com/seconddomain into IE it goes to the correct page again and the address bar keeps the seconddomain.com domain as typed. It doesn't revert to the maindomain.com domain.

However, the hosting company (just a little one man effort, as I am!) tells me they had nothing to do with this. They host maindomain.com, and only park (or something) the maindomain owners's seconddomain.com domain name.

My biggest problem right now is the fact that, before I removed the original site (that had been done by others) typing http://www.seconddomain.com into IE would bring you to the seconddomain folder and pages. I can't recall if it changed the address to http://www.secondomain.com/seconddomain/ or not. However, I would be satified - at present as a quick fix - for some type of code that, if somebody types http://www.seconddomain.com into IE it will redirect them to the proper seconddomain folder. While I'd prefer to keep the seconddomain.com in the address bar at that stage I'd be able to live with it reverting to the maindomain with the seconddomain subfolder just to stop it from going to the main domain's page.

Regards,

JoeB