You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wiki-changes@httpd.apache.org by Apache Wiki <wi...@apache.org> on 2009/01/11 19:25:35 UTC

[Httpd Wiki] Update of "RewriteVirtualHandler" by EricCovener

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The following page has been changed by EricCovener:
http://wiki.apache.org/httpd/RewriteVirtualHandler

The comment on the change is:
make it safe for per-dir, ^/?script.php is less confusing IMO than a condition

------------------------------------------------------------------------------
  For other handlers such as php scripts, use:
  {{{
  RewriteEngine On
+ RewriteCond %{REQUEST_URI} !=/script.php
- RewriteRule !^/script.php /script.php
+ RewriteRule .* /script.php
  }}}
  
  And for CGI scripts:
@@ -39, +40 @@

  RewriteEngine On
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d [OR]
  RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
+ RewriteCond %{REQUEST_URI} !=/script.php
- RewriteRule !^/script.php /script.php
+ RewriteRule .* /script.php
  }}}
  
  If the existing files you wish to have handled by your script have a common set of file extensions distinct from that of the hander, you can bypass {{{mod_rewrite}}} and use instead {{{mod_actions}}}. Let's say you want all .html and .tpl files to be dealt with by your script: