Forum Moderators: coopster & phranque

Message Too Old, No Replies

Is there a Win2000 equivalent to mod_rewrite?

         

Marcia

10:16 am on Sep 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would be for dealing with dynamic pages. Is there a feature that does the same thing?

sugarkane

2:21 pm on Sep 12, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think there's an explicit feature, but I've seen (somewhere) an approach that involves an asp 404 page. Basically, you link to something like data/1234/foo.asp (which doesn't exist), the 404 script kicks in and parses out 'data' and '1234' and then generates a page using that info.

Xoc

9:41 pm on Sep 19, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does mod_rewrite do?

bartek

9:53 pm on Sep 19, 2001 (gmt 0)

10+ Year Member



Here [httpd.apache.org], Xoc...

JuniorHarris

4:39 pm on Sep 21, 2001 (gmt 0)

10+ Year Member



A custom 404 asp error page can be used to intercept invalid URL requests, and in our case generate dynamic web pages directly from the database.

Using MMC change the default 404 (htm) page to use an asp script. Be sure NOT to use the browse feature, but instead select the URL option. (If URL option is not used, the server will not process the script and return the document directly to the client). The custom 404 Error can be set at any directory level, and will be executed whenever an invalid request is made to that directory (or sub-directory).

The custom 404 script would evaluate the ServerVariables("QUERY_STRING") variable to retrieve the invalid URL. Then the invalid URL would be parsed for variables to query the database and return the proper results. The dynamic page could be displayed directly through the 404 script, or even leverage the new IIS 5.0 Server.Transfer or Server.Execute methods which retain session state and session variables (but don't allow query strings).

Xoc

3:44 am on Sep 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, I understand now. I wrote about an ASP 404 handler in this [webmasterworld.com] thread. That should point you in the right direction.

JuniorHarris

4:45 pm on Sep 30, 2001 (gmt 0)

10+ Year Member



Great link and documentation Xoc...very nice!~

Marcia

6:17 pm on Sep 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Would an ASP 404 handler work for Cold Fusion?

JuniorHarris

5:35 pm on Oct 1, 2001 (gmt 0)

10+ Year Member



From what I've read yes it should work...though there may be a few extra things to setup for cold fusion. I'm not using CF so I can't offer any advice but I believe SimpleEnigma from spiderhunter might be able to offer some advice. I also found this excerpt from Eathan:

We tell IIS not to look for the file, but rather to pass the request directly to CF. CF let's you assign a single template to handle 404s and since CF doesn't know where anything is, all requests on the server go through that template.

This controller template first figures out what domain it's dealing with and what files are needed to handle requests on that domain. It then passes the requests along. Each domain has its own set of apps to interpret incoming requests and generate pages. Then CF says "here you go" and passes the code along to IIS and on to the browser.

We do it pretty much the same way in Apache, but I think Apache checks for the file before passing it off to CF. This is okay, but Apache includes a 404 header. IE has some friendly error message mumbo jumbo that will read the 404 header and ignore the code served (serves a friendly 404 rather the page). To fix this we use <cfheader statuscode="200" statustext="OK"> in the Missing Template Handler to write over the HTTP Status header on the way back to the browser.

Both are great guys who helped me create our 404 trap in ASP!~