Re: rewrite rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 March 2010 15:56, Richard Schoenig <Richard_Schoenig@xxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux