Adrienne Boswell wrote on 17 jun 2009 in
microsoft.public.inetserver.asp.general:
> Gazing into my crystal ball I observed
> =?Utf-8?B?amVmZmN0ZXN0LWdvb2dsZUB5YWhvby5jb20=?=
> <jeffctest-> writing in
> news:C6AD951E-20DA-4B01-AD20-:
>
>> "Evertjan." wrote:
>>
>>> This sounds illogical.
>>>
>>> Unless it is the defaultfile in a directory,
>>> the filename should be at the end of the URL.
>>
>> You're right. It is illogical. Let me try to make it a little clearer.
>> The website sits on an Intranet and in IIS, it's the Default Web Site.
>> Now to have this website accessible to the Internet, there is a server
>> that basically has an alias which points to a location on the Intranet
>> website, in this case the root /. For some illogical reason, this
>> other server creates the alias with a folder after the URL as in
>> "whatever.com/mine/". Probably not clear as to any of this but I'll
>> continue.
>>
>> So accessing the Intranet website using this new alias, turns the root
>> of the website now into /mine instead of /. So all the relative paths
>> of images, style sheets, etc. are now looking for a folder above where
>> the new root is. For example, this was a valid images path
>> "/images/myimage.gif" but now it really needs to be
>> "/mine/images/myimage.gif". I wasn't told this, I determined that's
>> why it was failing.
>>
>> I was hoping that there was something I'm not thinking of like
>> creating a virtual directory or something in IIS that would solve
>> everything immediately instead of having to edit every file that has a
>> relative path. The Base Href would still require editing all those
>> files, but at least that's only one addition rather than multiple
>> changes in a file. But there still has to be an easier way.
>>
>> And I'm not even going to mention the .NET virtual directory that
>> probably has the same problem.
>>
>> Hopefully that helps to clear things up. Thanks for replying and I'm
>> hoping there is an easy solution.
>>
>
> I think there is something you can do in IIS - I seem to remember having
> to do that a long time ago with some IIS server somewhere, but alas, I
> don't remember what I did.
>
> You might want to check in an IIS group, like
> microsoft.public.inetserver.iis .
I would catch all nonexisting calls that end up in 404.asp,
and response.redirect or server.transfer them to the factual url.
A simple all inclusive solution, if only you prevent the reentry of urls
that are not available under /mine/, which the below does automagically:
=================== 404.asp ================
<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
if instr(qstr,":80/mine/")=0 then
p = instr(qstr,":80/")
url = mid(qstr,P+3)
server.transfer "/mine/" & url
end if
%>
This is the 404 page, the page you requested does not exist.
============================================
Please test and adapt to your own peculiar

situation.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)