Accessing an ASP as /script.asp/param

J

Jedediah Smith

In order to facilitate search engine indexing, I'd like to be able to
access a script using something like this:

http://server/script.asp/param

where this would execute script.asp which could then retrieve the extra
data "param" using the PATH_INFO server variable. PHP has a feature
similar to this and I've heard that IIS can do the same thing but I'm not
quite sure how. I've already enabled PATH_INFO as detailed here:

http://support.microsoft.com/defaul...port/kb/articles/Q184/3/20.ASP&NoWebContent=1

However, when I try to access a URL like the above, I just get a 404
presumably because IIS is looking for a directory called script.asp. How
do I make it execute the script instead?

Thank you
 
K

Ken Schaefer

Is this actually a feature in PHP? Can you point me to the docs? Usually I
have seen this as a feature of Apache (via mod_rewrite).

With IIS, the only way I have seen is via an ISAPI filter that rewrites the
request. There are commercial versions available, and no doubt freeware
versions as well.

I believe there is a simple version available for IIS6 in the IIS 6 Resource
Kit tools:
http://www.microsoft.com/downloads/...ee-a71a-4c73-b628-ade629c89499&DisplayLang=en

Cheers
Ken

:
: In order to facilitate search engine indexing, I'd like to be able to
: access a script using something like this:
:
: http://server/script.asp/param
:
: where this would execute script.asp which could then retrieve the extra
: data "param" using the PATH_INFO server variable. PHP has a feature
: similar to this and I've heard that IIS can do the same thing but I'm not
: quite sure how. I've already enabled PATH_INFO as detailed here:
:
:
http://support.microsoft.com/defaul...port/kb/articles/Q184/3/20.ASP&NoWebContent=1
:
: However, when I try to access a URL like the above, I just get a 404
: presumably because IIS is looking for a directory called script.asp. How
: do I make it execute the script instead?
:
: Thank you
 
J

Jedediah Smith

Well, it's part of the CGI specification that you should be able to use
paths like this without any special modules or filters:

http://hoohoo.ncsa.uiuc.edu/cgi/env.html

This is the only purpose of the PATH_INFO variable so why would IIS
support it at all if it didn't work? I've heard conflicting reports about
this. On this page

http://bugs.php.net/bug.php?id=7782

a fellow claims that IIS does not support it. However, here:

http://www.phpbuilder.com/mail/php-windows/2000071/0106.php

someone says that he has it working (dated May 2000). This page on
Microsoft's site also implies that it works with a hotfix:

http://support.microsoft.com/defaul...port/kb/articles/Q252/3/52.ASP&NoWebContent=1

but it's an IIS4 hotfix. I can only assume the fix is integrated with IIS5.

Unfortunately, my hosting provider will not let me install ISAPI filters
so I have to get it working this way somehow.
 
K

Ken Schaefer

I think this is because ASP is not implemented as a CGI. It's implemented as
an API (ISAPI) filter.

Many server-side technologies are now implemented via APIs that are exposed
via the webserver software in question, because performance is usually
higher. However, you can also run somethings as CGIs, which offer lower
performance, but generally are more portable, since they are not tied to an
API exposed by the webserver software itself. So, you can have PHP
implemented as a CGI (php.exe) or as an IIS ISAPI filter. I would assume
that you can do whatever.server.com/php.exe/param/ but you can't do
whatever.server.com/something.php/param where .php is being intepreted via
the PHP ISAPI filter (as opposed to the PHP .exe)

(This is from long-lost memories from my programming studies at Uni, so it
may be somewhat incorrect as I'm not sure I remember it all correctly).

Cheers
Ken

:
: Well, it's part of the CGI specification that you should be able to use
: paths like this without any special modules or filters:
:
: http://hoohoo.ncsa.uiuc.edu/cgi/env.html
:
: This is the only purpose of the PATH_INFO variable so why would IIS
: support it at all if it didn't work? I've heard conflicting reports about
: this. On this page
:
: http://bugs.php.net/bug.php?id=7782
:
: a fellow claims that IIS does not support it. However, here:
:
: http://www.phpbuilder.com/mail/php-windows/2000071/0106.php
:
: someone says that he has it working (dated May 2000). This page on
: Microsoft's site also implies that it works with a hotfix:
:
:
http://support.microsoft.com/defaul...port/kb/articles/Q252/3/52.ASP&NoWebContent=1
:
: but it's an IIS4 hotfix. I can only assume the fix is integrated with
IIS5.
:
: Unfortunately, my hosting provider will not let me install ISAPI filters
: so I have to get it working this way somehow.
:
: On Tue, 4 Nov 2003 22:05:05 +1100, Ken Schaefer
:
: > Is this actually a feature in PHP? Can you point me to the docs? Usually
: > I
: > have seen this as a feature of Apache (via mod_rewrite).
: >
: > With IIS, the only way I have seen is via an ISAPI filter that rewrites
: > the
: > request. There are commercial versions available, and no doubt freeware
: > versions as well.
: >
: > I believe there is a simple version available for IIS6 in the IIS 6
: > Resource
: > Kit tools:
: >
http://www.microsoft.com/downloads/...ee-a71a-4c73-b628-ade629c89499&DisplayLang=en
: >
: > Cheers
: > Ken
: >
message
: > : > :
: > : In order to facilitate search engine indexing, I'd like to be able to
: > : access a script using something like this:
: > :
: > : http://server/script.asp/param
: > :
: > : where this would execute script.asp which could then retrieve the
extra
: > : data "param" using the PATH_INFO server variable. PHP has a feature
: > : similar to this and I've heard that IIS can do the same thing but I'm
: > not
: > : quite sure how. I've already enabled PATH_INFO as detailed here:
: > :
: > :
: >
http://support.microsoft.com/defaul...port/kb/articles/Q184/3/20.ASP&NoWebContent=1
: > :
: > : However, when I try to access a URL like the above, I just get a 404
: > : presumably because IIS is looking for a directory called script.asp.
: > How
: > : do I make it execute the script instead?
: > :
: > : Thank you
: >
: >
:
:
:
: --
: Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top