httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Wigg <p...@philipwigg.co.uk>
Subject Re: [users@httpd] rewrite rule
Date Thu, 11 Mar 2010 16:16:19 GMT
On 11 March 2010 15:56, Richard Schoenig <Richard_Schoenig@picis.com> wrote:
> So here is the issue I am having now I have separate servers I am trying to
> set this rule up on so that if a n=1 or an n=2 it accesses server 1, and if
> an n=3 then it accesses server 2
>
>
>
> The rules I have setup are on server 2 I have it configured like this
>
> <IfModule mod_rewrite.c>
>
> RewriteEngine on
>
> Options +FollowSymlinks
>
> RewriteCond %{QUERY_STRING}  ^(n=[1-2]+)$
>
> RewriteRule ^/perl.pl$ http://server1/perl.pl?%1 [R,L]
>
> </IfModule>
>
>
>
> This seems to work fine and redirects to server 1 the way I want.
>
>
>
> However on server 1 I have it configured with
>
> <IfModule mod_rewrite.c>
>
> RewriteEngine on
>
> Options +FollowSymlinks
>
> RewriteCond %{QUERY_STRING}  ^(n=[3]+)$
>
> RewriteRule ^/perl.pl$ http://server2/perl.pl?%1 [R,L]
>
> </IfModule>

> As I said server 2 seems to work fine, but server 1 I cannot seem to get to
> work at all it seems to get in a loop and does nothing.

Debugging mod_rewrite rules is much easier if you configure a
RewriteLog so you can see what mod_rewrite is actually doing:-

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog

Also try using curl, fiddler, firebug or some other tool to actually
see what responses you're getting from the server when you make a
request.

-- Phil

---------------------------------------------------------------------
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