Re: RewriteRule and AccelPass conflict
On Mon, Jun 24, 2002 at 06:12:04PM -0400, Robert Landrum wrote: > I would think that you would need something like the following. > > > SetHandler rewrite accel > # rewrite rules and accel rules > > > Or something like that... Your goal is to stack these handlers, so that > rewrite happens first and accel second. That doesn't work: $ apachectl configtest Syntax error on line 1011 of /usr/local/apache/conf/httpd.conf: SetHandler takes one argument, a handler name
Re: RewriteRule and AccelPass conflict
On Mon, Jun 24, 2002 at 05:37:51PM -0400, Philip Mak wrote: > I'm trying to add a RewriteRule, but it's not working: > > RewriteEngine on > RewriteCond %{HTTP_HOST} !^www.animewallpapers.com(:80)?$ > RewriteCond %{HTTP_HOST} !^64.246.28.97(:80)?$ > RewriteRule ^/(.*) http://www.animewallpapers.com/$1 [L,R] > > I want to make it so that if someone accesses that website via any > hostname other than www.animewallpapers.com or 64.246.28.97, then it > will redirect them to http://www.animewallpapers.com/. I copied those > rules exactly from another httpd.conf where it works. > > However, the directives were being ignored. I realized the problem is > probably because of this line: > > AccelPass / http://127.0.0.1:8010/ > I would think that you would need something like the following. SetHandler rewrite accel # rewrite rules and accel rules Or something like that... Your goal is to stack these handlers, so that rewrite happens first and accel second. I've never tried this, but it might work Rob -- Robert Landrum Systems Programmer
RewriteRule and AccelPass conflict
I'm trying to add a RewriteRule, but it's not working: RewriteEngine on RewriteCond %{HTTP_HOST} !^www.animewallpapers.com(:80)?$ RewriteCond %{HTTP_HOST} !^64.246.28.97(:80)?$ RewriteRule ^/(.*) http://www.animewallpapers.com/$1 [L,R] I want to make it so that if someone accesses that website via any hostname other than www.animewallpapers.com or 64.246.28.97, then it will redirect them to http://www.animewallpapers.com/. I copied those rules exactly from another httpd.conf where it works. However, the directives were being ignored. I realized the problem is probably because of this line: AccelPass / http://127.0.0.1:8010/ The site has a mod_perl backend running on port 8010. Apache is proxying those connections to port 8010 before it has a chance to invoke the RewriteRule above. I thought of putting the RewriteRule on the backend mod_perl, but I don't think it will work there because the HTTP_HOST would have been changed to 127.0.0.1. Any suggestions on how I can get the RewriteRule to take precedence over the AccelPass?