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

top-level directory

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I have an application that installs a web interface via Microsoft IIS (We're using Windows 2000 and thus IIS 5.0). The web interface has hundreds of html pages that are coded with links such as:

href="/cgi-bin/program.exe"

The leading / of course causes this to be appended immediately after the domain. I need to place this is a subdirectory. I want all links coded as above to go to:


rather than:


If there anyway to change what is used for the top-level directory?? Changing all the links is not an option as some of them are hard coded into the executables.
 
er.... wouldn't it be easier to simply move the top level directory to point to subdir instead? Or am I misunderstanding your question?

:-)

RW


 
Actually I'm wanting to install multiple copies of this web interface, so I can give administrators access to one and remove options that our support personal have access to in the other (this software package supports multiple interfaces). They reccommend however, installing each one to a seperate hostname:


What I want to do it as follows


The problem is that the links are coded as I mentioned above as:

a href="/cgi-bin/program.exe".

When you click on one of those links from EIHTER interface, you go back to:


I need them to stay within their own directories. Clicking on that link from interface1 needs to go to:


And from interface 2 you would get:


Also, as I mentioned before, changing all the links on the webpages is not an option, as some of them are hardcoded into the executables.

Is there any way this can be done???
 
I currently have a headache, so the following suggestion might be insane ;-)

So, you have

and

The link
a href="/cgi-bin/program.exe".
would take you to

at which point you actually want to go to either

or

depending on where the link was.

Try this....

Have
but empty it of all files. Hence you will always get a 404 error. Use the IIS facility to have a custom 404 message which is an asp (or CGI script - either should work).
The script looks at the http_referrer and then does a redirect to

if the http_referrer was
and so on

Hope this makes sense. Now I must go and get some aspirin :-)

RW
 
I actually thought of that after my post and have since tested it. It works great almost.... There are several forms that are setup as follows:

<FORM NAME=&quot;SearchForm&quot; METHOD=&quot;POST&quot; ACTION=&quot;/cgi-bin/Program.exe&quot;>

Those don't seem to be forwarded by the asp script. My knowledge of asp is quite limited, so it may be possible, but my way isn't working at the moment.

I tried each of the following lines:

Server.Transfer(url)
Response.Redirect(url)

Neither work with the forms mentioned above.
 
What the ASP will have to do is to read all the form variables and then post those to the new form - a redirect will not work.

I'd kind of thought that you only ever wanted to redirect to &quot;program.exe&quot;, so I never took this into account.

I'll leave it up to a proper ASP programmer to suggest the best way to do this. I'd probably iterate through the response object to get the name/value pairs and then do a bit of DHTML to simulate the form we are trying to do the re-direct for.

RW
 
Sounds like this is getting a little more complicated that what I was looking for. I can install the interfaces on different websites and aviod this problem altogether, but I wanted to do it this way if possible and not too complicated.

Oh well... thanks for the help anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top