httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MadTh <madan.feedb...@gmail.com>
Subject Re: [users@httpd] Redirect a complex URL to another one, either in httpd.conf or with htaccess
Date Tue, 09 Mar 2010 00:40:49 GMT
none worked so far








On Tue, Mar 9, 2010 at 5:18 AM, Igor Cicimov <icicimov@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=17&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@gmail.com> wrote:
>
>>
>> Hi,
>>
>> Can you suggest any redirect rule  for redirecting
>>
>>
>>
>> https://www.domain.com/index.php?opt=dom_cont&task=view&id=18&Itemid=28
>>
>> to page
>>
>> https://www.domain.com/index.php?opt=dom_cont&task=view&id=17&Itemid=27
>>
>>
>>
>>
>>
>>
>> Thanks
>>
>>
>>
>>
>

Mime
View raw message