Project

General

Profile

Actions

Feature #348

closed

Enhance mod_rewrite with some of the apache mod_rewrite features

Added by Anonymous about 19 years ago. Updated about 18 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_rewrite
Target version:
-
ASK QUESTIONS IN Forums:

Description

It would be really nice if there was a way to have a mod_rewrite rule that only matched if a condition was met like !-f in the apache mod_rewrite's RewriteCond directive. Its needed to impliment page caching where if a static file doesn't exist, mod_rewrite sends the request to a dynamic page which creates the static version for future requests.

Actions #1

Updated by jan about 19 years ago

  • Status changed from New to Fixed
  • Resolution set to invalid

server.error-handler-404 = "/fastcgi.app" does all you need for this already.

If the file doesn't exist it will result in a 404 which can be catched and internally redirected to a handler (here "/fastcgi.app").

Actions #2

Updated by Anonymous almost 19 years ago

I agree with anonymous here, conditional rewrites are more flexible, since you can rewrite any number of missing files to any number of handlers, ie

"^viewtopic/.+$" => "viewtopic.php?$1"
"^news/.+$" => "news.php?$1"

et cetera. This allows for flexible caching without the use of mod_cml

-- black

Actions #3

Updated by Anonymous almost 19 years ago

Related to / has duplicate of #413.

-- ryandesign

Actions #4

Updated by Anonymous almost 19 years ago

Or, older still, duplicate of #237.

-- ryandesign

Actions #5

Updated by jan about 18 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to duplicate
Actions

Also available in: Atom