httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Bray" <nood...@gmail.com>
Subject Re: [users@httpd] mod_rewrite problem
Date Wed, 07 Mar 2007 20:48:49 GMT
On 08/03/07, Israel Brewster <israel@frontierflying.com> wrote:
> Thanks for your response and suggestions.
>
> On Mar 7, 2007, at 9:48 AM, Vincent Bray wrote:
>
> > Hi, welcome to rewrite-in-htaccess pain and suffering. As you're able
> > to use RewriteLog, why put rewrite rules in htaccess?
>
> When I tried that my RewriteRules stopped working entirely :P I
> suspect that was just a mis-configuration on my part, however, so
> I'll keep looking.

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule in
the note 'per directory Rewrites' is important when moving rewrite
rules from .htaccess files or <Directory> blocks, to per-server
(VirtualHost, or main server) contexts. In this case, ^nagios never
matches because the per-directory prefix isn't stripped. ^/nagios is
what you need, in addition to simillar changes for the rest of your
rules.
This annoyance aside, putting rewrite rules in server context has
other advantages, mainly increased speed (regexen are compiled once at
startup and the uri->filepath translation stage can be skipped) but
also decreased confusion; rewrite in htaccess involves extra steps
beyond what seems reasonable to figure out the resulting url.


-- 
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message