asp page from htm page

G

guy

I have an htm page which is often visted and it's a very established page
and for that reason I cannot change its extension to asp. However, I want to
run a bit of VB code on the server whenever that page is accessed that logs
a couple of details about the accessor (i.e. user) of the htm page. My
question is: How do I launch an asp page (just to run some logging code)
from an htm page.

Perhaps if I explain what I'm trying to achieve then someone can suggest a
better solution:

When a search engine bot crawls my home page I want to log/email the
date/time and bot details. I was thinking of doing this through some VB code
on an ASP page. The bot, however, is crawling my www.mysite.com/index.htm
page so I can't use server side (ASP) code on the page because it's an htm
page.

Thanks
 
J

Jason Brown [MSFT]

Well, for one thing, the information you're looking for is probably in the
IIS logs - however it IS possible to run ASP code in a file marked .htm

do you have full access to this machine, or is it a shared server? (answer
I'm looking for: full administrative access)


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.
 
G

guy

It's a shared server: i.e. I have my web hosted with a web hosting company.
They, unfortunately, don't give me access to the logs and for that reason I
can't see the info I want.

I do have a number of admin capabilities on the host server via the control
pannel. For example I can set the individual write permissions on files and
directories for IUSR_... etc.

I'm guessing from you're answer that on the IIS admin application you can
set IIS to recognize ASP code in an htm file...?
 
E

Evertjan.

guy wrote on 28 feb 2005 in microsoft.public.inetserver.asp.general:
I have an htm page which is often visted and it's a very established
page and for that reason I cannot change its extension to asp.
However, I want to run a bit of VB code on the server whenever that
page is accessed that logs a couple of details about the accessor
(i.e. user) of the htm page. My question is: How do I launch an asp
page (just to run some logging code) from an htm page.

Perhaps if I explain what I'm trying to achieve then someone can
suggest a better solution:

<img src="/myManipulations/myVBcodeinASP.asp"
style="width:1px;display:none;">
When a search engine bot crawls my home page I want to log/email the
date/time and bot details. I was thinking of doing this through some
VB code on an ASP page. The bot, however, is crawling my
www.mysite.com/index.htm page so I can't use server side (ASP) code on
the page because it's an htm page.

same.
 
J

Jeff Cochran

I have an htm page which is often visted and it's a very established page
and for that reason I cannot change its extension to asp. However, I want to
run a bit of VB code on the server whenever that page is accessed that logs
a couple of details about the accessor (i.e. user) of the htm page. My
question is: How do I launch an asp page (just to run some logging code)
from an htm page.

Perhaps if I explain what I'm trying to achieve then someone can suggest a
better solution:

When a search engine bot crawls my home page I want to log/email the
date/time and bot details. I was thinking of doing this through some VB code
on an ASP page. The bot, however, is crawling my www.mysite.com/index.htm
page so I can't use server side (ASP) code on the page because it's an htm
page.

Bots will normally also crawl ASP, but you have two options. Either
change the HTM extension processing to be processed by the ASP.DLL, or
create an ASP page and use it, then change your HTML to forward to the
ASP page.

Jeff
 
G

guy

Works like a dream - thanks.
:)

Evertjan. said:
guy wrote on 28 feb 2005 in microsoft.public.inetserver.asp.general:


<img src="/myManipulations/myVBcodeinASP.asp"
style="width:1px;display:none;">


same.
 
G

guy

I tried this on my htm page:
<img src="/myManipulations/myVBcodeinASP.asp"
style="width:1px;display:none;">

As suggested before you suggested the redirecting idea and this (the above)
solution works very well.

Thanks for your help.
 
J

Jason Brown [MSFT]

If you have access to the script mappings you can map .htm to be processed
by asp.dll. unforunately, I don't think you have that kind of access.


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top