重定向301无效

时间:2017-09-15 09:21:30

标签: .htaccess redirect url-redirection http-status-code-301 http-redirect

我最近更改了我的网址,我需要从以下位置进行301重定向:

^auto-second-hand/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1

^piata-auto/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1

我试试

RewriteRule ^auto-second-hand/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1 ^piata-auto/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1  [L,QSA,NC,R=301]

但是它还没有尝试

RedirectMatch 301 ^auto-second-hand/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1 ^piata-auto/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1

我哪里错了?感谢

1 个答案:

答案 0 :(得分:0)

RewriteRule ^\^auto-second-hand/\(\[A-Za-z0-9,-\]\+\)/\$ afisare-judete\.php$ /^piata-auto/([A-Za-z0-9,-]+)/$ afisare-judete.php?judet=$1 [L,R=301]

希望这有助于:)