On Apr 28, 2008, at 3:38 PM, Mac Newbold wrote:

Apr 22 at 10:11am, Richard K Miller said:

I'm not sure you could do *any* URL rewriting without at least a bare minimum of mod_rewrite.

Sorry to resurrect a thread that ended last week, but I wanted to bring up a method that takes a different approach to it. One benefit, though I don't recommend it, is that it isn't Apache dependent. Even IIS can do it, though it is limited in some ways.

One way to perform an equivalent function (allow nice looking URLs that don't correspond to files Apache could serve directly) without using mod_rewrite is to specify a PHP script as your ErrorDocument in your web server config or .htaccess. (Any web server that will let you choose to run a PHP script on error instead of sending back a 404 and an html page can do this.)

For example, put in your .htaccess or apache config:

ErrorDocument 404 /error.php


Great point, Mac. I recall Datawolf (I believe) spoke about this technique at a UPHPU meeting a couple years ago. I believe he was even using the 404 document to check referring sites and notify them automatically if they had a bad link to his site.

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to