rewrite.php or redirect.php
| From: | Tino Hendricks | Date: | Sat, 06 Jan 2001 15:57:12 +0000 |
| Subject: | rewrite.php or redirect.php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33033@lists.php.net to get a copy of this message | ||
Hi, gurus!
I want to redirect a user to a series of other directories if a "404 - not
found" occurs. The script should look up the requested file in several
directories and - if finally found - return this one.
The god of apache´s mod_rewrite writes, this should better _not_ be done by
an apache "RewriteRule", but with an ErrorDocument (e.g. "handle404.php").
Three problems/questions:
1) The variables passed to the "does_not_exist.php" to not automatically
turn into PHP-variables. Nor "include " neither "require" allow passing
variables via a HTTP-query string. So a (time consuming?) walk through some
arrays needs to be done?
2) Is it really a performant way to:
- let a 404 occur
- call the error document
- update error_log and access_log
- walk through the directories
- restore the variables from the original request
- call the "does_exist.php"?
3) Since this behaviour can be the standard one (instead of finding the
requested doc by first hit) the error_log will definitely explode. (Okay,
can be cleaned by cron, but makes it hard to find the 'real' mistakes)
If some points here seem off topic please just ignore. :-)
Thank you very much for any opinion!
Tino
www.interpool-online.de