【问题标题】:Redirect 301 not working重定向 301 不起作用
【发布时间】:2018-02-24 10:36:24
【问题描述】:

我最近更改了我的网址,我需要从以下位置进行 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

我哪里错了?谢谢

【问题讨论】:

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


【解决方案1】:
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]

希望这会有所帮助:)

【讨论】:

  • 非常感谢,但它给了我错误 500“内部服务器错误”
  • 编辑了那里的行
  • 没有人可以帮助我吗? :(
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-06-05
  • 2013-11-27
  • 2014-04-30
  • 2011-09-16
  • 2017-12-08
相关资源
最近更新 更多