需要重定向此格式:
https://old.com/pages/1248/some-title
https://new.com/pages/1248/some-title
我把这个代码放在纸盘中
RewriteRule ^pages/(\d+)/[^/]+$ https://new.com/pages/$1/+[^/] [R=301,L]
但是在“ some-title”上显示失败,看起来像这样: https://new.com/pages/1248/%2B%5B%5E/%5D
答案 0 :(得分:0)
Solvet
RewriteRule ^pages/(\d+)/(.*) https://new.com/pages/$1/$2 [R=301,L]
添加(.*)
即可