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

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

 



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&&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@xxxxxxxxx> 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





[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