Redirect a complex URL to another one, either in httpd.conf or with

--00504502cc9e6340ae0481523016
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Can you suggest any redirect rule for redirecting



https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28

to page

https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27






Thanks

--00504502cc9e6340ae0481523016
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br>Hi,<br><br>Can you suggest any redirect rule=A0 for redirecting <br><br=
><br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_cont&tas=
k=3Dview&id=3D18&Itemid=3D28">https://www.domain.com /index.php?opt=
=3Ddom_cont&task=3Dview&id=3D18&Itemid=3D28</a><br>
<br>to page<br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_co=
nt&task=3Dview&id=3D17&Itemid=3D27">https://www. domain.com/inde=
x.php?opt=3Ddom_cont&task=3Dview&id=3D17&Itemid= 3D27</a><br><br=
><br><br><br><br>
<br>Thanks<br><br><br><br>

--00504502cc9e6340ae0481523016--
Madan Thapa [ Di, 09 März 2010 00:11 ] [ ID #2034429 ]

Re: Redirect a complex URL to another one, either in

On Mon, Mar 8, 2010 at 6:11 PM, MadTh <madan.feedback [at] gmail.com> wrote:
>
> Hi,
>
> Can you suggest any redirect rule=A0 for redirecting
>
>
>
> https://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview& id=3D18&Itemi=
d=3D28
>
> to page
>
> https://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview& id=3D17&Itemi=
d=3D27

http://wiki.apache.org/httpd/RewriteQueryString


--
Eric Covener
covener [at] gmail.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
Eric Covener [ Di, 09 März 2010 00:19 ] [ ID #2034431 ]

Re: Redirect a complex URL to another one, either in

--00163641780bbe66260481525f85
Content-Type: text/plain; charset=ISO-8859-1

Hi!

You must to write some kind of script, maybe PHP since you're using it, and
subtract 1 from both parameters. With mod_rewrite olny you're unable to do
this, since it works only with strings (using regex).


On Mon, Mar 8, 2010 at 8:11 PM, MadTh <madan.feedback [at] gmail.com> wrote:

>
> Hi,
>
> Can you suggest any redirect rule for redirecting
>
>
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28
>
> to page
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27
>
>
>
>
>
>
> Thanks
>
>
>
>

--00163641780bbe66260481525f85
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi!<div><br></div><div>You must to write some kind of script, maybe PHP sin=
ce you're using it, and subtract 1 from both parameters. With mod_rewri=
te olny you're unable to do this, since it works only with strings (usi=
ng regex).</div>
<div><br></div><div><br><div class=3D"gmail_quote">On Mon, Mar 8, 2010 at 8=
:11 PM, MadTh <span dir=3D"ltr"><<a href=3D"mailto:madan.feedback [at] gmail.=
com">madan.feedback [at] gmail.com</a>></span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex;">
<br>Hi,<br><br>Can you suggest any redirect rule=A0 for redirecting <br><br=
><br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_cont&tas=
k=3Dview&id=3D18&Itemid=3D28" target=3D"_blank">https://www.domain.=
com/index.php?opt=3Ddom_cont&task=3Dview&id=3D18& ;Itemid=3D28</a=
><br>

<br>to page<br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_co=
nt&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">https://w=
ww.domain.com/index.php?opt=3Ddom_cont&task=3Dview&i d=3D17&Item=
id=3D27</a><br>
<br><br><br><br><br>
<br>Thanks<br><br><br><br>
</blockquote></div><br></div>

--00163641780bbe66260481525f85--
Gustavo Straube [ Di, 09 März 2010 00:25 ] [ ID #2034433 ]

Re: Redirect a complex URL to another one, either in

--00163628521295624c048152b4c3
Content-Type: text/plain; charset=ISO-8859-1

Well for a simple redirect this should work (not tested)

RewriteEngine On
RewriteCond %{QUERY_STRING} opt=dom_cont
RewriteCond %{QUERY_STRING} task=view
RewriteCond %{QUERY_STRING} id=18
RewriteCond %{QUERY_STRING} Itemid=28
RewriteRule ^/index.php$
https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27[R,L]

if this is your only link you want to redirect ... but something tells me
you will need more generic one that redirects links with id=xx&Itemid=yy to
id=xx-1&Itemid=yy-1 ... am I right :)

In that case try this:

RewriteEngine On
RewriteCond %{QUERY_STRING} opt=dom_cont
RewriteCond %{QUERY_STRING} task=view
RewriteCond %{QUERY_STRING} id=([0-9]{2})
RewriteCond %{QUERY_STRING} Itemid=([0-9]{2})
RewriteRule ^/index.php$
https://www.domain.com/index.php?opt=dom_cont&task=view&<https://www.domain.com/index.php?opt=dom_cont&task=view&id=17&Itemid=27>&id=%1-1&Itemid=%2-1
[R,L]

not sure though if apache will do the math on %1 and %2 or take the -1 part
as string...curious to find out from you :)

Cheers

On Tue, Mar 9, 2010 at 10:11 AM, MadTh <madan.feedback [at] gmail.com> wrote:

>
> Hi,
>
> Can you suggest any redirect rule for redirecting
>
>
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28
>
> to page
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27
>
>
>
>
>
>
> Thanks
>
>
>
>

--00163628521295624c048152b4c3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Well for a simple redirect this should work (not tested)<br><br>RewriteEngi=
ne On<br>RewriteCond %{QUERY_STRING} opt=3Ddom_cont<br>RewriteCond %{QUERY_=
STRING} task=3Dview<br>RewriteCond %{QUERY_STRING} id=3D18<br>RewriteCond %=
{QUERY_STRING} Itemid=3D28<br>

RewriteRule ^/index.php$ <a href=3D"https://www.domain.com/index.php?opt=3D=
dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &id=3D17&am=
p;Itemid=3D27</a> [R,L]<br>
<br>if this is your only link you want to redirect ... but something tells =
me you will need more generic one that redirects links with id=3Dxx&Ite=
mid=3Dyy to id=3Dxx-1&Itemid=3Dyy-1=A0 ... am I right :)<br>
<br>In that case try this:<br><br>RewriteEngine On<br>RewriteCond %{QUERY_S=
TRING} opt=3Ddom_cont<br>RewriteCond %{QUERY_STRING} task=3Dview<br>Rewrite=
Cond %{QUERY_STRING} id=3D([0-9]{2})<br>RewriteCond %{QUERY_STRING} Itemid=
=3D([0-9]{2})<br>
RewriteRule ^/index.php$ <a href=3D"https://www.domain.com/index.php?opt=3D=
dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &</a>&i=
d=3D%1-1&Itemid=3D%2-1 [R,L]<br>
<br>not sure though if apache will do the math on %1 and %2 or take the -1 =
part as string...curious to find out from you :)<br><br>Cheers<br><br><div =
class=3D"gmail_quote">On Tue, Mar 9, 2010 at 10:11 AM, MadTh <span dir=3D"l=
tr"><<a href=3D"mailto:madan.feedback [at] gmail.com" target=3D"_blank">madan=
..feedback [at] gmail.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;">
<br>Hi,<br><br>Can you suggest any redirect rule=A0 for redirecting <br><br=
><br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_cont&tas=
k=3Dview&id=3D18&Itemid=3D28" target=3D"_blank">https://www.domain.=
com/index.php?opt=3Ddom_cont&task=3Dview&id=3D18& ;Itemid=3D28</a=
><br>


<br>to page<br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_co=
nt&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">https://w=
ww.domain.com/index.php?opt=3Ddom_cont&task=3Dview&i d=3D17&Item=
id=3D27</a><br>

<br><br><br><br><br>
<br>Thanks<br><br><br><br>
</blockquote></div><br>

--00163628521295624c048152b4c3--
Igor Cicimov [ Di, 09 März 2010 00:48 ] [ ID #2034440 ]

Re: Redirect a complex URL to another one, either in

--001636e9078fe068fc0481536e42
Content-Type: text/plain; charset=ISO-8859-1

none worked so far








On Tue, Mar 9, 2010 at 5:18 AM, Igor Cicimov <icicimov [at] gmail.com> wrote:

> Well for a simple redirect this should work (not tested)
>
> RewriteEngine On
> RewriteCond %{QUERY_STRING} opt=dom_cont
> RewriteCond %{QUERY_STRING} task=view
> RewriteCond %{QUERY_STRING} id=18
> RewriteCond %{QUERY_STRING} Itemid=28
> RewriteRule ^/index.php$
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27[R,L]
>
> if this is your only link you want to redirect ... but something tells me
> you will need more generic one that redirects links with id=xx&Itemid=yy to
> id=xx-1&Itemid=yy-1 ... am I right :)
>
> In that case try this:
>
> RewriteEngine On
> RewriteCond %{QUERY_STRING} opt=dom_cont
> RewriteCond %{QUERY_STRING} task=view
> RewriteCond %{QUERY_STRING} id=([0-9]{2})
> RewriteCond %{QUERY_STRING} Itemid=([0-9]{2})
> RewriteRule ^/index.php$
> https://www.domain.com/index.php?opt=dom_cont&task=view&<https://www.domain.com/index.php?opt=dom_cont&task=view&id=17&Itemid=27>&id=%1-1&Itemid=%2-1
> [R,L]
>
> not sure though if apache will do the math on %1 and %2 or take the -1 part
> as string...curious to find out from you :)
>
> Cheers
>
>
> On Tue, Mar 9, 2010 at 10:11 AM, MadTh <madan.feedback [at] gmail.com> wrote:
>
>>
>> Hi,
>>
>> Can you suggest any redirect rule for redirecting
>>
>>
>>
>> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28
>>
>> to page
>>
>> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27
>>
>>
>>
>>
>>
>>
>> Thanks
>>
>>
>>
>>
>

--001636e9078fe068fc0481536e42
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

none worked so far<br><br><br><br><br><br><br><br><br><div class=3D"gmail_q=
uote">On Tue, Mar 9, 2010 at 5:18 AM, Igor Cicimov <span dir=3D"ltr"><<a=
href=3D"mailto:icicimov [at] gmail.com">icicimov [at] gmail.com</a>></span> wrote=
:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Well for a simple=
redirect this should work (not tested)<br><br>RewriteEngine On<br>RewriteC=
ond %{QUERY_STRING} opt=3Ddom_cont<br>
RewriteCond %{QUERY_STRING} task=3Dview<br>RewriteCond %{QUERY_STRING} id=
=3D18<br>RewriteCond %{QUERY_STRING} Itemid=3D28<br>

RewriteRule ^/index.php$ <a href=3D"https://www.domain.com/index.php?opt=3D=
dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &id=3D17&am=
p;Itemid=3D27</a> [R,L]<br>

<br>if this is your only link you want to redirect ... but something tells =
me you will need more generic one that redirects links with id=3Dxx&Ite=
mid=3Dyy to id=3Dxx-1&Itemid=3Dyy-1=A0 ... am I right :)<br>
<br>In that case try this:<br><br>RewriteEngine On<br>RewriteCond %{QUERY_S=
TRING} opt=3Ddom_cont<br>RewriteCond %{QUERY_STRING} task=3Dview<br>Rewrite=
Cond %{QUERY_STRING} id=3D([0-9]{2})<br>RewriteCond %{QUERY_STRING} Itemid=
=3D([0-9]{2})<br>

RewriteRule ^/index.php$ <a href=3D"https://www.domain.com/index.php?opt=3D=
dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &</a>&i=
d=3D%1-1&Itemid=3D%2-1 [R,L]<br>

<br>not sure though if apache will do the math on %1 and %2 or take the -1 =
part as string...curious to find out from you :)<br><br>Cheers<div><div></d=
iv><div class=3D"h5"><br><br><div class=3D"gmail_quote">On Tue, Mar 9, 2010=
at 10:11 AM, MadTh <span dir=3D"ltr"><<a href=3D"mailto:madan.feedback [at] =
gmail.com" target=3D"_blank">madan.feedback [at] gmail.com</a>></span> wrote:=
<br>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi,<br><br>Can you suggest any redirect rule=A0 for redirecting <br><br=
><br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_cont&tas=
k=3Dview&id=3D18&Itemid=3D28" target=3D"_blank">https://www.domain.=
com/index.php?opt=3Ddom_cont&task=3Dview&id=3D18& ;Itemid=3D28</a=
><br>



<br>to page<br><br><a href=3D"https://www.domain.com/index.php?opt=3Ddom_co=
nt&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">https://w=
ww.domain.com/index.php?opt=3Ddom_cont&task=3Dview&i d=3D17&Item=
id=3D27</a><br>


<br><br><br><br><br>
<br>Thanks<br><br><br><br>
</blockquote></div><br>
</div></div></blockquote></div><br>

--001636e9078fe068fc0481536e42--
Madan Thapa [ Di, 09 März 2010 01:40 ] [ ID #2034443 ]

Re: Redirect a complex URL to another one, either in

On Mon, Mar 8, 2010 at 6:48 PM, Igor Cicimov <icicimov [at] gmail.com> wrote:

> RewriteRule ^/index.php$
> https://www.domain.com/index.php?opt=dom_cont&task=view&&id= %1-1&Itemid=%2-1
> [R,L]
>

You probably need a RewriteMap to do that increment.

--
Eric Covener
covener [at] gmail.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
Eric Covener [ Di, 09 März 2010 01:44 ] [ ID #2034444 ]
Webserver » gmane.comp.apache.user » Redirect a complex URL to another one, either in httpd.conf or with

Vorheriges Thema: Re: Redirect a complex URL to another one, either in
Nächstes Thema: SSL mutual authentication client certificate creation using Keytool