简体   繁体   中英

How to 301 redirect with htaccess URL php variables

I have to move permanent 301 link to new one but I have some problems with my htaccess file where I have rewriterules.

I have

RewriteRule ^([a-z]+)/(.*)/kat,([0-9a-z]+),([0-9]+),([0-9]+)$ index.php?section=catalog&make=show&link=$2&lang=$1&cat=$3&depth=$4&page=$5 [L]

web is working on that and i have links like:

www.web.com/en/page_name/cat,5,1,1

and now i need to make 301 from

www.web.com/en/page_name/cat,5,1,1

to

www.web.com/en/new_name/cat,6,1,1

I was trying redirectmatch, redirect and some rewriterule but with no success.

Is this what you want?

RewriteRule ^([a-z]+)/(.*)/kat,5,1,1$ /$1/$2/kat,6,1,1 [L,R=301]
RewriteRule ^([a-z]+)/(.*)/kat,([0-9a-z]+),([0-9]+),([0-9]+)$ index.php?section=catalog&make=show&link=$2&lang=$1&cat=$3&depth=$4&page=$5 [L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM