rewrite rule
------_=_NextPart_001_01CAC081.8038D8D6
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I am new to using mod_rewrite and have been trying to create a rule to=0D
do something rather simple, but keep hitting a wall. I have been trying=0D
to research online how to do it, but I keep finding global changes and=0D
not specific to what I am trying to do. Essentially I am looking to use=0D
a rewrite rule to redirect users in an application from=0D
=0D
=0D
=0D
http://server4/perl.pl?n=3D1 to http://server1/perl.pl?n=3D1=0D
=0D
=0D
=0D
=0D
=0D
I tried using =0D
=0D
RewriteEngine on=0D
=0D
Options +FollowSymlinks=0D
=0D
RewriteCond %{QUERY_STRING} ^n=3D1$=0D
=0D
RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
=0D
RewriteCond %{QUERY_STRING} ^n=3D2$=0D
=0D
RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
=0D
RewriteCond %{QUERY_STRING} ^n=3D3$=0D
=0D
RewriteRule ^$ http://mypcname/perl.pl [L]=0D
=0D
=0D
=0D
=0D
=0D
=0D
=0D
To test on my local host but I am guessing that it is not even close to=0D
what I want to do.=0D
=0D
=0D
=0D
=0D
=0D
The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.=0D
------_=_NextPart_001_01CAC081.8038D8D6
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:m=3D"http://schema=
s.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html=
40">=0D
=0D
<head>=0D
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">=
=0D
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">=0D
<style>=0D
<!--=0D
/* Font Definitions */=0D
[at] font-face=0D
{font-family:"Cambria Math";=0D
panose-1:2 4 5 3 5 4 6 3 2 4;}=0D
[at] font-face=0D
{font-family:Calibri;=0D
panose-1:2 15 5 2 2 2 4 3 2 4;}=0D
/* Style Definitions */=0D
p.MsoNormal, li.MsoNormal, div.MsoNormal=0D
{margin:0in;=0D
margin-bottom:.0001pt;=0D
font-size:11.0pt;=0D
font-family:"Calibri","sans-serif";}=0D
a:link, span.MsoHyperlink=0D
{mso-style-priority:99;=0D
color:blue;=0D
text-decoration:underline;}=0D
a:visited, span.MsoHyperlinkFollowed=0D
{mso-style-priority:99;=0D
color:purple;=0D
text-decoration:underline;}=0D
span.EmailStyle17=0D
{mso-style-type:personal-compose;=0D
font-family:"Calibri","sans-serif";=0D
color:windowtext;}=0D
..MsoChpDefault=0D
{mso-style-type:export-only;}=0D
[at] page Section1=0D
{size:8.5in 11.0in;=0D
margin:1.0in 1.0in 1.0in 1.0in;}=0D
div.Section1=0D
{page:Section1;}=0D
-->=0D
</style>=0D
<!--[if gte mso 9]><xml>=0D
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />=0D
</xml><![endif]--><!--[if gte mso 9]><xml>=0D
<o:shapelayout v:ext=3D"edit">=0D
<o:idmap v:ext=3D"edit" data=3D"1" />=0D
</o:shapelayout></xml><![endif]-->=0D
</head>=0D
=0D
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>=0D
=0D
<div class=3DSection1>=0D
=0D
<p class=3DMsoNormal>I am new to using mod_rewrite and have been trying to =
create=0D
a rule to do something rather simple, but keep hitting a wall. I have=
=0D
been trying to research online how to do it, but I keep finding global chan=
ges=0D
and not specific to what I am trying to do. Essentially I am looking =
to=0D
use a rewrite rule to redirect users in an application from<o:p></o:p></p>=
=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal><span class=3DMsoHyperlink><a href=3D"http://server4/p=
erl.pl?n=3D1">http://server4/perl.pl?n=3D1</a></span> =0D
to <span class=3DMsoHyperlink><a href=3D"http://server1/perl.pl?n=3D1">http=
://server1/perl.pl?n=3D1</a></span><o:p></o:p></p>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal>I tried using <o:p></o:p></p>=0D
=0D
<p class=3DMsoNormal>RewriteEngine on<o:p></o:p></p>=0D
=0D
<p class=3DMsoNormal>Options +FollowSymlinks<o:p></o:p></p>=0D
=0D
<p class=3DMsoNormal>RewriteCond %{QUERY_STRING} ^n=3D1$<o:p></o:p></=
p>=0D
=0D
<p class=3DMsoNormal>RewriteRule ^$ http://127.0.0.1/ perl.pl [L]<o:p></o:p=
></p>=0D
=0D
<p class=3DMsoNormal>RewriteCond %{QUERY_STRING} ^n=3D2$<o:p></o:p></=
p>=0D
=0D
<p class=3DMsoNormal>RewriteRule ^$ http://127.0.0.1/ perl.pl [L]<o:p></o:p=
></p>=0D
=0D
<p class=3DMsoNormal>RewriteCond %{QUERY_STRING} ^n=3D3$<o:p></o:p></=
p>=0D
=0D
<p class=3DMsoNormal>RewriteRule ^$ http://mypcname/perl.pl [L]<o:p></o:p><=
/p>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal>To test on my local host but I am guessing that it is =
not=0D
even close to what I want to do.<o:p></o:p></p>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto'> <o:p></o:p></p>=0D
=0D
</div>=0D
=0D
The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.
</body>=0D
=0D
</html>=0D
------_=_NextPart_001_01CAC081.8038D8D6--
Re: rewrite rule
On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig
<Richard_Schoenig [at] picis.com> wrote:
> I am new to using mod_rewrite and have been trying to create a rule to do
> something rather simple, but keep hitting a wall.=A0 I have been trying t=
o
> research online how to do it, but I keep finding global changes and not
> specific to what I am trying to do.=A0 Essentially I am looking to use a
> rewrite rule to redirect users in an application from
>
>
>
> http://server4/perl.pl?n=3D1=A0 to http://server1/perl.pl?n=3D1
>
>
>
>
>
> I tried using
>
> RewriteEngine on
>
> Options +FollowSymlinks
>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D1$
>
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D2$
>
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D3$
>
> RewriteRule ^$ http://mypcname/perl.pl [L]
>
>
>
>
>
>
>
> To test on my local host but I am guessing that it is not even close to w=
hat
> I want to do.
>
>
>
>
>
> The information in this email is confidential and may be legally privileg=
ed.
> It is intended solely for the addressee. Access or use by any other perso=
n
> to this internet email is not authorized and may be unlawful. If you are =
not
> the intended recipient, please delete or destroy this email. If you do no=
t
> wish to receive future emails from this sender, please reply directly to
> this email requesting you be removed from any mailing list.
You want to redirect or rewrite ?
--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
------------------------------------------------------------ ---------
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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Re: rewrite rule
--001485e8eddebba2eb0481809201
Content-Type: text/plain; charset=ISO-8859-1
>
> http://server4/perl.pl?n=1 to http://server1/perl.pl?n=1
>
You can't test it on the localhost since you are redirecting some page to
itself => infinite loop
Try redirecting to some imaginary domain or google.com
RewriteCond %{QUERY_STRING} ^(n=[0-9]+)$
RewriteRule ^/perl.pl$ http://google.com/perl.pl?%1 [R,L]
and if the browser gets back the googles 404 page not found and your address
bar looks like "http://www.google.com/perl.pl?n=1" => your rule is good
Igor
On Thu, Mar 11, 2010 at 3:56 PM, Nilesh Govindarajan <lists [at] itech7.com>wrote:
> On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig
> <Richard_Schoenig [at] picis.com> wrote:
> > I am new to using mod_rewrite and have been trying to create a rule to do
> > something rather simple, but keep hitting a wall. I have been trying to
> > research online how to do it, but I keep finding global changes and not
> > specific to what I am trying to do. Essentially I am looking to use a
> > rewrite rule to redirect users in an application from
> >
> >
> >
> > http://server4/perl.pl?n=1 to http://server1/perl.pl?n=1
> >
> >
> >
> >
> >
> > I tried using
> >
> > RewriteEngine on
> >
> > Options +FollowSymlinks
> >
> > RewriteCond %{QUERY_STRING} ^n=1$
> >
> > RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
> >
> > RewriteCond %{QUERY_STRING} ^n=2$
> >
> > RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
> >
> > RewriteCond %{QUERY_STRING} ^n=3$
> >
> > RewriteRule ^$ http://mypcname/perl.pl [L]
> >
> >
> >
> >
> >
> >
> >
> > To test on my local host but I am guessing that it is not even close to
> what
> > I want to do.
> >
> >
> >
> >
> >
> > The information in this email is confidential and may be legally
> privileged.
> > It is intended solely for the addressee. Access or use by any other
> person
> > to this internet email is not authorized and may be unlawful. If you are
> not
> > the intended recipient, please delete or destroy this email. If you do
> not
> > wish to receive future emails from this sender, please reply directly to
> > this email requesting you be removed from any mailing list.
>
> You want to redirect or rewrite ?
>
> --
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
>
> ------------------------------------------------------------ ---------
> 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 [at] httpd.apache.org
> " from the digest: users-digest-unsubscribe [at] httpd.apache.org
> For additional commands, e-mail: users-help [at] httpd.apache.org
>
>
--001485e8eddebba2eb0481809201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<blockquote style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(=
204, 204, 204); padding-left: 1ex;" class=3D"gmail_quote"><span><a href=3D"=
http://server4/perl.pl?n=3D1" target=3D"_blank">http://server4/perl.pl?n=3D=
1</a></span>=A0
to <span><a href=3D"http://server1/perl.pl?n=3D1" target=3D"_blank">http://=
server1/perl.pl?n=3D1</a></span><br></blockquote><br>You can't test it =
on the localhost since you are redirecting some page to itself=A0 =3D> i=
nfinite loop<br>
<br>Try redirecting to some imaginary domain or <a href=3D"http://google.co=
m">google.com</a><br><br><br>=A0=A0=A0 RewriteCond %{QUERY_STRING}=A0 ^(n=
=3D[0-9]+)$<br>=A0=A0=A0 RewriteRule ^/<a href=3D"http://perl.pl">perl.pl</=
a>$ <a href=3D"http://google.com/perl.pl?%1">http://google.com/perl.pl?%1</=
a> [R,L]<br>
<br>and if the browser gets back the googles 404 page not found and your ad=
dress bar looks like "<a href=3D"http://www.google.com/perl.pl?n=3D1">=
http://www.google.com/perl.pl?n=3D1</a>" =3D> your rule is good<br>=
<br>
<br>Igor<br><br><br><div class=3D"gmail_quote">On Thu, Mar 11, 2010 at 3:56=
PM, Nilesh Govindarajan <span dir=3D"ltr"><<a href=3D"mailto:lists [at] itec=
h7.com" target=3D"_blank">lists [at] itech7.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><=
div>On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig<br>
<<a href=3D"mailto:Richard_Schoenig [at] picis.com" target=3D"_blank">Richard=
_Schoenig [at] picis.com</a>> wrote:<br>
> I am new to using mod_rewrite and have been trying to create a rule to=
do<br>
> something rather simple, but keep hitting a wall.=A0 I have been tryin=
g to<br>
> research online how to do it, but I keep finding global changes and no=
t<br>
> specific to what I am trying to do.=A0 Essentially I am looking to use=
a<br>
> rewrite rule to redirect users in an application from<br>
><br>
><br>
><br>
> <a href=3D"http://server4/perl.pl?n=3D1" target=3D"_blank">http://serv=
er4/perl.pl?n=3D1</a>=A0 to <a href=3D"http://server1/perl.pl?n=3D1" target=
=3D"_blank">http://server1/perl.pl?n=3D1</a><br>
><br>
><br>
><br>
><br>
><br>
> I tried using<br>
><br>
> RewriteEngine on<br>
><br>
> Options +FollowSymlinks<br>
><br>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D1$<br>
><br>
> RewriteRule ^$ <a href=3D"http://127.0.0.1/" target=3D"_blank">http://=
127.0.0.1/</a> <a href=3D"http://perl.pl" target=3D"_blank">perl.pl</a> [L]=
<br>
><br>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D2$<br>
><br>
> RewriteRule ^$ <a href=3D"http://127.0.0.1/" target=3D"_blank">http://=
127.0.0.1/</a> <a href=3D"http://perl.pl" target=3D"_blank">perl.pl</a> [L]=
<br>
><br>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D3$<br>
><br>
> RewriteRule ^$ <a href=3D"http://mypcname/perl.pl" target=3D"_blank">h=
ttp://mypcname/perl.pl</a> [L]<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> To test on my local host but I am guessing that it is not even close t=
o what<br>
> I want to do.<br>
><br>
><br>
><br>
><br>
><br>
> The information in this email is confidential and may be legally privi=
leged.<br>
> It is intended solely for the addressee. Access or use by any other pe=
rson<br>
> to this internet email is not authorized and may be unlawful. If you a=
re not<br>
> the intended recipient, please delete or destroy this email. If you do=
not<br>
> wish to receive future emails from this sender, please reply directly =
to<br>
> this email requesting you be removed from any mailing list.<br>
<br>
</div></div>You want to redirect or rewrite ?<br>
<br>
--<br>
Nilesh Govindarajan<br>
Site & Server Administrator<br>
<a href=3D"http://www.itech7.com" target=3D"_blank">www.itech7.com</a><br>
<br>
------------------------------------------------------------ ---------<br>
The official User-To-User support forum of the Apache HTTP Server Project.<=
br>
See <URL:<a href=3D"http://httpd.apache.org/userslist.html" target=3D"_b=
lank">http://httpd.apache.org/userslist.html</a>> for more info.<br>
To unsubscribe, e-mail: <a href=3D"mailto:users-unsubscribe [at] httpd.apache.or=
g" target=3D"_blank">users-unsubscribe [at] httpd.apache.org</a><br>
=A0 " =A0 from the digest: <a href=3D"mailto:users-digest-unsubscribe=
[at] httpd.apache.org" target=3D"_blank">users-digest-unsubscribe [at] httpd.apache.=
org</a><br>
For additional commands, e-mail: <a href=3D"mailto:users-help [at] httpd.apache.=
org" target=3D"_blank">users-help [at] httpd.apache.org</a><br>
<br>
</blockquote></div><br>
--001485e8eddebba2eb0481809201--
RE: rewrite rule
------_=_NextPart_001_01CAC133.721C7D1E
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
So here is the issue I am having now I have separate servers I am trying=0D
to set this rule up on so that if a n=3D1 or an n=3D2 it accesses server 1,=
=0D
and if an n=3D3 then it accesses server 2=0D
=0D
=0D
=0D
The rules I have setup are on server 2 I have it configured like this=0D
=0D
<IfModule mod_rewrite.c>=0D
=0D
RewriteEngine on=0D
=0D
Options +FollowSymlinks=0D
=0D
RewriteCond %{QUERY_STRING} ^(n=3D[1-2]+)$=0D
=0D
RewriteRule ^/perl.pl$ http://server1/perl.pl?%1 [R,L]=0D
=0D
</IfModule>=0D
=0D
=0D
=0D
This seems to work fine and redirects to server 1 the way I want.=0D
=0D
=0D
=0D
However on server 1 I have it configured with =0D
=0D
<IfModule mod_rewrite.c>=0D
=0D
RewriteEngine on=0D
=0D
Options +FollowSymlinks=0D
=0D
RewriteCond %{QUERY_STRING} ^(n=3D[3]+)$=0D
=0D
RewriteRule ^/perl.pl$ http://server2/perl.pl?%1 [R,L]=0D
=0D
</IfModule>=0D
=0D
=0D
=0D
As I said server 2 seems to work fine, but server 1 I cannot seem to get=0D
to work at all it seems to get in a loop and does nothing.=0D
=0D
Any and all help would be greatly appreciated.=0D
=0D
=0D
=0D
=0D
=0D
=0D
=0D
>From: Igor Cicimov [mailto:icicimov [at] gmail.com] =0D
>Sent: Thursday, March 11, 2010 12:32 AM=0D
>To: users [at] httpd.apache.org=0D
>Subject: Re: [users [at] httpd] rewrite rule=0D
=0D
=0D
=0D
>http://server4/perl.pl?n=3D1 to http://server1/perl.pl?n=3D1=0D
=0D
=0D
>You can't test it on the localhost since you are redirecting some page=0D
to itself =3D> infinite loop=0D
=0D
Try redirecting to some imaginary domain or google.com=0D
=0D
=0D
> RewriteCond %{QUERY_STRING} ^(n=3D[0-9]+)$=0D
> RewriteRule ^/perl.pl$ http://google.com/perl.pl?%1=0D
<http://google.com/perl.pl?%251> [R,L]=0D
=0D
>and if the browser gets back the googles 404 page not found and your=0D
address bar looks like >"http://www.google.com/perl.pl?n=3D1" =3D> your rul=
e=0D
is good=0D
=0D
=0D
>Igor=0D
=0D
=0D
=0D
>On Thu, Mar 11, 2010 at 3:56 PM, Nilesh Govindarajan <lists [at] itech7.com>=0D
wrote:=0D
=0D
>On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig=0D
><Richard_Schoenig [at] picis.com> wrote:=0D
> I am new to using mod_rewrite and have been trying to create a rule to=0D
do=0D
> something rather simple, but keep hitting a wall. I have been trying=0D
to=0D
> research online how to do it, but I keep finding global changes and=0D
not=0D
> specific to what I am trying to do. Essentially I am looking to use a=0D
> rewrite rule to redirect users in an application from=0D
>=0D
>=0D
>=0D
> http://server4/perl.pl?n=3D1 to http://server1/perl.pl?n=3D1=0D
>=0D
>=0D
>=0D
>=0D
>=0D
> I tried using=0D
>=0D
> RewriteEngine on=0D
>=0D
> Options +FollowSymlinks=0D
>=0D
> RewriteCond %{QUERY_STRING} ^n=3D1$=0D
>=0D
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
>=0D
> RewriteCond %{QUERY_STRING} ^n=3D2$=0D
>=0D
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
>=0D
> RewriteCond %{QUERY_STRING} ^n=3D3$=0D
>=0D
> RewriteRule ^$ http://mypcname/perl.pl [L]=0D
>=0D
>=0D
>=0D
>=0D
>=0D
>=0D
>=0D
> To test on my local host but I am guessing that it is not even close=0D
to what=0D
> I want to do.=0D
>=0D
>=0D
>=0D
>=0D
>=0D
> The information in this email is confidential and may be legally=0D
privileged.=0D
> It is intended solely for the addressee. Access or use by any other=0D
person=0D
> to this internet email is not authorized and may be unlawful. If you=0D
are not=0D
> the intended recipient, please delete or destroy this email. If you do=0D
not=0D
> wish to receive future emails from this sender, please reply directly=0D
to=0D
> this email requesting you be removed from any mailing list.=0D
=0D
You want to redirect or rewrite ?=0D
=0D
--=0D
Nilesh Govindarajan=0D
Site & Server Administrator=0D
www.itech7.com=0D
=0D
------------------------------------------------------------ ---------=0D
The official User-To-User support forum of the Apache HTTP Server=0D
Project.=0D
See <URL:http://httpd.apache.org/userslist.html> for more info.=0D
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org=0D
" from the digest: users-digest-unsubscribe [at] httpd.apache.org=0D
For additional commands, e-mail: users-help [at] httpd.apache.org=0D
=0D
=0D
=0D
The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.=0D
------_=_NextPart_001_01CAC133.721C7D1E
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">=0D
=0D
<head>=0D
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">=
=0D
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">=0D
<style>=0D
<!--=0D
/* Font Definitions */=0D
[at] font-face=0D
{font-family:"Cambria Math";=0D
panose-1:2 4 5 3 5 4 6 3 2 4;}=0D
[at] font-face=0D
{font-family:Calibri;=0D
panose-1:2 15 5 2 2 2 4 3 2 4;}=0D
[at] font-face=0D
{font-family:Tahoma;=0D
panose-1:2 11 6 4 3 5 4 4 2 4;}=0D
/* Style Definitions */=0D
p.MsoNormal, li.MsoNormal, div.MsoNormal=0D
{margin:0in;=0D
margin-bottom:.0001pt;=0D
font-size:12.0pt;=0D
font-family:"Times New Roman","serif";}=0D
a:link, span.MsoHyperlink=0D
{mso-style-priority:99;=0D
color:blue;=0D
text-decoration:underline;}=0D
a:visited, span.MsoHyperlinkFollowed=0D
{mso-style-priority:99;=0D
color:purple;=0D
text-decoration:underline;}=0D
span.EmailStyle17=0D
{mso-style-type:personal-reply;=0D
font-family:"Calibri","sans-serif";=0D
color:#1F497D;}=0D
..MsoChpDefault=0D
{mso-style-type:export-only;}=0D
[at] page Section1=0D
{size:8.5in 11.0in;=0D
margin:1.0in 1.0in 1.0in 1.0in;}=0D
div.Section1=0D
{page:Section1;}=0D
-->=0D
</style>=0D
<!--[if gte mso 9]><xml>=0D
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />=0D
</xml><![endif]--><!--[if gte mso 9]><xml>=0D
<o:shapelayout v:ext=3D"edit">=0D
<o:idmap v:ext=3D"edit" data=3D"1" />=0D
</o:shapelayout></xml><![endif]-->=0D
</head>=0D
=0D
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>=0D
=0D
<div class=3DSection1>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>So here is the issue I am having now I have separate servers=
I=0D
am trying to set this rule up on so that if a n=3D1 or an n=3D2 it accesses=
server=0D
1, and if an n=3D3 then it accesses server 2<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><o:p> </o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>The rules I have setup are on server 2 I have it configured =
like=0D
this<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><IfModule mod_rewrite.c><o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>RewriteEngine on<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>Options +FollowSymlinks<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>RewriteCond %{QUERY_STRING} ^(n=3D[1-2]+)$<o:p></o:p><=
/span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>RewriteRule ^/perl.pl$ http://server1/perl.pl?%1 [R,L]<o:p><=
/o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'></IfModule><o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><o:p> </o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>This seems to work fine and redirects to server 1 the way I=
=0D
want.<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><o:p> </o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>However on server 1 I have it configured with <o:p></o:p></s=
pan></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><IfModule mod_rewrite.c><o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>RewriteEngine on<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>Options +FollowSymlinks<o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>RewriteCond %{QUERY_STRING} ^(n=3D[3]+)$<o:p></o:p></s=
pan></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>RewriteRule ^/perl.pl$ http://server2/perl.pl?%1 [R,L]<o:p><=
/o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'></IfModule><o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><o:p> </o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>As I said server 2 seems to work fine, but server 1 I cannot=
=0D
seem to get to work at all it seems to get in a loop and does nothing.<o:p>=
</o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'>Any and all help would be greatly appreciated.<o:p></o:p></s=
pan></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><o:p> </o:p></span></p>=0D
=0D
<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto'><span=0D
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497D'=
> <o:p></o:p></span></p>=0D
=0D
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";=0D
color:#1F497D'><o:p> </o:p></span></p>=0D
=0D
<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in'>=0D
=0D
<p class=3DMsoNormal>><b><span style=3D'font-size:10.0pt;font-family:"Ta=
homa","sans-serif"'>From:</span></b><span=0D
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > Igor Cicimov=
=0D
[mailto:icicimov [at] gmail.com] <br>=0D
</span>><b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-se=
rif"'>Sent:</span></b><span=0D
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > Thursday, Mar=
ch 11,=0D
2010 12:32 AM<br>=0D
</span>><b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-se=
rif"'>To:</span></b><span=0D
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >=0D
users [at] httpd.apache.org<br>=0D
</span>><b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-se=
rif"'>Subject:</span></b><span=0D
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > Re: [users [at] ht=
tpd]=0D
rewrite rule<o:p></o:p></span></p>=0D
=0D
</div>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
<blockquote style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0i=
n 0in 0in 6.0pt;=0D
margin-left:4.8pt;margin-right:0in'>=0D
=0D
<p class=3DMsoNormal>><a href=3D"http://server4/perl.pl?n=3D1" target=3D=
"_blank">http://server4/perl.pl?n=3D1</a> =0D
to <a href=3D"http://server1/perl.pl?n=3D1" target=3D"_blank">http://server=
1/perl.pl?n=3D1</a><o:p></o:p></p>=0D
=0D
</blockquote>=0D
=0D
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><br>=0D
>You can't test it on the localhost since you are redirecting some page =
to=0D
itself =3D> infinite loop<br>=0D
<br>=0D
Try redirecting to some imaginary domain or <a href=3D"http://google.com">g=
oogle.com</a><br>=0D
<br>=0D
<br>=0D
> RewriteCond %{QUERY_STRING} ^(n=3D[0-9]+)$<br>=
=0D
> RewriteRule ^/<a href=3D"http://perl.pl">perl.pl</a>=
$ <a=0D
href=3D"http://google.com/perl.pl?%251">http://google.com/pe rl.pl?%1</a> [R=
,L]<br>=0D
<br>=0D
>and if the browser gets back the googles 404 page not found and your=0D
address bar looks like >"<a href=3D"http://www.google.com/perl.pl?n=
=3D1">http://www.google.com/perl.pl?n=3D1</a>"=0D
=3D> your rule is good<br>=0D
<br>=0D
<br>=0D
>Igor<br>=0D
<br>=0D
<o:p></o:p></p>=0D
=0D
<div>=0D
=0D
<p class=3DMsoNormal>>On Thu, Mar 11, 2010 at 3:56 PM, Nilesh Govindaraj=
an=0D
<<a href=3D"mailto:lists [at] itech7.com" target=3D"_blank">lists [at] itech7.com<=
/a>>=0D
wrote:<o:p></o:p></p>=0D
=0D
<div>=0D
=0D
<div>=0D
=0D
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'>>On Thu, Mar 11, 201=
0 at=0D
12:12 AM, Richard Schoenig<br>=0D
><<a href=3D"mailto:Richard_Schoenig [at] picis.com" target=3D"_blank">Ric=
hard_Schoenig [at] picis.com</a>>=0D
wrote:<br>=0D
> I am new to using mod_rewrite and have been trying to create a rule to=
do<br>=0D
> something rather simple, but keep hitting a wall. I have been tr=
ying=0D
to<br>=0D
> research online how to do it, but I keep finding global changes and no=
t<br>=0D
> specific to what I am trying to do. Essentially I am looking to =
use=0D
a<br>=0D
> rewrite rule to redirect users in an application from<br>=0D
><br>=0D
><br>=0D
><br>=0D
> <a href=3D"http://server4/perl.pl?n=3D1" target=3D"_blank">http://serv=
er4/perl.pl?n=3D1</a> =0D
to <a href=3D"http://server1/perl.pl?n=3D1" target=3D"_blank">http://server=
1/perl.pl?n=3D1</a><br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
> I tried using<br>=0D
><br>=0D
> RewriteEngine on<br>=0D
><br>=0D
> Options +FollowSymlinks<br>=0D
><br>=0D
> RewriteCond %{QUERY_STRING} ^n=3D1$<br>=0D
><br>=0D
> RewriteRule ^$ <a href=3D"http://127.0.0.1/" target=3D"_blank">http://=
127.0.0.1/</a>=0D
<a href=3D"http://perl.pl" target=3D"_blank">perl.pl</a> [L]<br>=0D
><br>=0D
> RewriteCond %{QUERY_STRING} ^n=3D2$<br>=0D
><br>=0D
> RewriteRule ^$ <a href=3D"http://127.0.0.1/" target=3D"_blank">http://=
127.0.0.1/</a>=0D
<a href=3D"http://perl.pl" target=3D"_blank">perl.pl</a> [L]<br>=0D
><br>=0D
> RewriteCond %{QUERY_STRING} ^n=3D3$<br>=0D
><br>=0D
> RewriteRule ^$ <a href=3D"http://mypcname/perl.pl" target=3D"_blank">h=
ttp://mypcname/perl.pl</a>=0D
[L]<br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
> To test on my local host but I am guessing that it is not even close t=
o=0D
what<br>=0D
> I want to do.<br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
><br>=0D
> The information in this email is confidential and may be legally=0D
privileged.<br>=0D
> It is intended solely for the addressee. Access or use by any other pe=
rson<br>=0D
> to this internet email is not authorized and may be unlawful. If you a=
re=0D
not<br>=0D
> the intended recipient, please delete or destroy this email. If you do=
not<br>=0D
> wish to receive future emails from this sender, please reply directly =
to<br>=0D
> this email requesting you be removed from any mailing list.<o:p></o:p>=
</p>=0D
=0D
</div>=0D
=0D
</div>=0D
=0D
<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'>You want to redirect or=
rewrite=0D
?<br>=0D
<br>=0D
--<br>=0D
Nilesh Govindarajan<br>=0D
Site & Server Administrator<br>=0D
<a href=3D"http://www.itech7.com" target=3D"_blank">www.itech7.com</a><br>=
=0D
<br>=0D
------------------------------------------------------------ ---------<br>=
=0D
The official User-To-User support forum of the Apache HTTP Server Project.<=
br>=0D
See <URL:<a href=3D"http://httpd.apache.org/userslist.html" target=3D"_b=
lank">http://httpd.apache.org/userslist.html</a>>=0D
for more info.<br>=0D
To unsubscribe, e-mail: <a href=3D"mailto:users-unsubscribe [at] httpd.apache.or=
g"=0D
target=3D"_blank">users-unsubscribe [at] httpd.apache.org</a><br>=0D
" from the digest: <a=0D
href=3D"mailto:users-digest-unsubscribe [at] httpd.apache.org" target=3D"_blank"=
>users-digest-unsubscribe [at] httpd.apache.org</a><br>=0D
For additional commands, e-mail: <a href=3D"mailto:users-help [at] httpd.apache.=
org"=0D
target=3D"_blank">users-help [at] httpd.apache.org</a><o:p></o:p></p>=0D
=0D
</div>=0D
=0D
<p class=3DMsoNormal><o:p> </o:p></p>=0D
=0D
</div>=0D
=0D
The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.
</body>=0D
=0D
</html>=0D
------_=_NextPart_001_01CAC133.721C7D1E--
Re: rewrite rule
On 11 March 2010 15:56, Richard Schoenig <Richard_Schoenig [at] 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=3D1 or an n=3D2 it accesses server 1, =
and if
> an n=3D3 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}=A0 ^(n=3D[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}=A0 ^(n=3D[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#rewrit elog
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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Re: rewrite rule
On Thu, Mar 11, 2010 at 16:56, Richard Schoenig
<Richard_Schoenig [at] 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=3D1 or an n=3D2 it accesses server 1, =
and if
> an n=3D3 then it accesses server 2
>
[...]
> RewriteCond %{QUERY_STRING}=C2=A0 ^(n=3D[3]+)$
Why [3]+? 3+ is largely enough. 3 is an atom, like any character
class. And it will match 3, 33, 333, etc, whether it is written [3]+
or 3+, so this is probably not what you want.
Remember that quantifiers (+, *, {...}) apply to the immediately preceding =
atom.
--
Francis Galiegue
ONE2TEAM
Ing=C3=A9nieur syst=C3=A8me
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge [at] one2team.com
40 avenue Raymond Poincar=C3=A9
75116 Paris
------------------------------------------------------------ ---------
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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Re: rewrite rule
--001485e3dee61636f504818d0da5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Just put ^(n=3D3)$ and it will work
On Mar 12, 2010 3:34 AM, "Francis GALIEGUE" <fge [at] one2team.com> wrote:
On Thu, Mar 11, 2010 at 16:56, Richard Schoenig
<Richard_Schoenig [at] 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 ...
[...]
> RewriteCond %{QUERY_STRING} ^(n=3D[3]+)$
Why [3]+? 3+ is largely enough. 3 is an atom, like any character
class. And it will match 3, 33, 333, etc, whether it is written [3]+
or 3+, so this is probably not what you want.
Remember that quantifiers (+, *, {...}) apply to the immediately preceding
atom.
--
Francis Galiegue
ONE2TEAM
Ing=E9nieur syst=E8me
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge [at] one2team.com
40 avenue Raymond Poincar=E9
75116 Paris
------------------------------------------------------------ --------- The
official User-To-User sup...
--001485e3dee61636f504818d0da5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p>Just put ^(n=3D3)$ and it will work<br>
</p>
<p><blockquote type=3D"cite">On Mar 12, 2010 3:34 AM, "Francis GALIEGU=
E" <<a href=3D"mailto:fge [at] one2team.com">fge [at] one2team.com</a>> wr=
ote:<br><br>On Thu, Mar 11, 2010 at 16:56, Richard Schoenig<br>
<p><font color=3D"#500050"><<a href=3D"mailto:Richard_Schoenig [at] picis.com=
">Richard_Schoenig [at] picis.com</a>> wrote:
</font></p><p><font color=3D"#500050">> So here is the issue I am having=
now I have separate servers I am trying to
> set this rule up on ...</font></p>[...]<br>
<p><font color=3D"#500050">> RewriteCond %{QUERY_STRING}=A0 ^(n=3D[3]+)$
</font></p>Why [3]+? 3+ is largely enough. 3 is an atom, like any character=
<br>
class. And it will match 3, 33, 333, etc, whether it is written [3]+<br>
or 3+, so this is probably not what you want.<br>
<br>
Remember that quantifiers (+, *, {...}) apply to the immediately preceding =
atom.<br>
--<br>
<font color=3D"#888888"><br>
Francis Galiegue<br>
ONE2TEAM<br>
Ing=E9nieur syst=E8me<br>
Mob : +33 (0) 683 877 875<br>
Tel : +33 (0) 178 945 552<br>
<a href=3D"mailto:fge [at] one2team.com">fge [at] one2team.com</a><br>
40 avenue Raymond Poincar=E9<br>
75116 Paris<br>
</font><p><font color=3D"#500050">
------------------------------------------------------------ ---------
The official User-To-User sup...</font></p></blockquote></p>
--001485e3dee61636f504818d0da5--