Could also combine it with FSO to allow checking whether or not the file
exists first;
slash_pos = InStrRev(Request.ServerVariables("QUERY_STRING"),"/")
length = Len(Request.ServerVariables("QUERY_STRING"))
Dim FSO
Set FSO = Server.Createobject("scripting.filesystemobject")
pagename = Right(Request.ServerVariables("QUERY_STRING"),length-slash_pos) &
".htm"
if fso.fileexists(Server.MapPath(pagename)) Then
Response.Redirect pagename
else
response.redirect "error.asp"
end if
set FSO = nothing
--
Regards
Steven Burn
Ur I.T. Mate Group
<a style='text-decoration: underline;' href="http://www.it-mate.co.uk" target="_blank">www.it-mate.co.uk</a>
Keeping it FREE!
"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:cee1v2$i8u18@kcweb01.netnews.att.com...
> "Mike" <Mike.RemoveThis@discussions.microsoft.com> wrote in message
> news:106A56E5-C3E1-4861-8B6F-999F02E7DA26@microsoft.com...
> > I am wanting to allow the ability for somone to find a file by typing
the
> path/name in the address bar without having to add the extension .htm. For
> example, <a style='text-decoration: underline;' href="http://www.its.com/department" target="_blank">http://www.its.com/department</a> should bring up the same as if they
> entered <a style='text-decoration: underline;' href="http://www.its.com/department.htm" target="_blank">http://www.its.com/department.htm</a> . What is the best way to
handle?
> I already have on the Site>Documents the Default.htm and Default.asp.
Thanks
> for the help
>
>
> A bit of a kludge, but you could create a custom 404 error page that
> redirects to the desired page. This has not been tested:
>
> slash_pos = InStrRev(Request.ServerVariables("QUERY_STRING"),"/")
> length = Len(Request.ServerVariables("QUERY_STRING"))
> pagename = Right(Request.ServerVariables("QUERY_STRING"),length-slash_pos)
> Response.Redirect pagename & ".htm"
>
> --
> Tom Kaminski IIS MVP
<font color=purple> > <a style='text-decoration: underline;' href="http://www.microsoft.com/windowsserver2003/community/centers/iis/</font" target="_blank">http://www.microsoft.com/windowsserver2003/community/centers/iis/</font</a>>
<font color=purple> > <a style='text-decoration: underline;' href="http://mvp.support.microsoft.com/</font" target="_blank">http://mvp.support.microsoft.com/</font</a>>
<font color=purple> > <a style='text-decoration: underline;' href="http://www.iisfaq.com/</font" target="_blank">http://www.iisfaq.com/</font</a>>
> <a style='text-decoration: underline;' href="http://www.iistoolshed.com/" target="_blank">http://www.iistoolshed.com/</a> - tools, scripts, and utilities for running
IIS
<font color=purple> > <a style='text-decoration: underline;' href="http://www.tryiis.com</font" target="_blank">http://www.tryiis.com</font</a>>
>
><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Pulling up a file without typing the htm ext.