Forum Moderators: open

Message Too Old, No Replies

/page.asp/foo1/foo2/ doesn't work

Trying to build more-elegant URLs, I get a 404 error

         

guarriman

10:24 am on Jan 17, 2006 (gmt 0)

10+ Year Member



Hi.

Working on 'Windows Server 2003 + Microsoft-IIS/6.0', I'd like to
create this kind of URLs:
[myserver.com...]

I'd like to use:
------
myPath = Request.ServerVariables("PATH_INFO")
-----
in order to handle it and build more-elegant URLs, instead of
page.asp?id=foo1&user=foo2

But when accessing that URL, I get a 404 error message. Any
similar experience?

Thank you very much.

Easy_Coder

11:41 am on Jan 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>http://www.myserver.com/page.asp/foo1/foo2/

Don't you want
[myserver.com...]

guarriman

12:11 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



Nope.

I want myserver.com/page.asp/foo1/foo2/

It's possible with PHP or Cgi-Perl.

Easy_Coder

2:35 pm on Jan 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>.asp/foo1/foo2/
does that (slash after extension) meet the rcf guidelines for a valid url though?

macrost

7:41 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



guarriman,
The easiest way to accomplish this is to create a page called 404.asp or what have you.

Second, in IIS, set the default 404 handler to URL and point it to where the 404.asp page sits.

Third, use a url that's like http://www.example.com/foo-page_url/bar1-bar2/bar3. You can use any combination of url's like this.

Forth, in your 404 page, it's easy to grab the URL that's being hit, split your variables needed, then perform DB calls or how you are serving up content.

Any questions, sticky me.