301 .htaccess中的重定向导致错误的重定向

时间:2015-06-29 14:56:10

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

我正在尝试将http://brisbaneamazingrace.com.au/details.html重定向到http://www.teambonding.com.au/activities/amazing-race-brisbane,这是一个不同的域。在我的.htaccess文件中我有

Redirect 301 http://brisbaneamazingrace.com.au/details.html http://www.teambonding.com.au/activities/amazing-race-brisbane

但重定向会转到http://teambonding.com.au/activities/amazing-race-brisbane details.html

它不断将details.html添加到重定向网址的末尾。那是什么?

1 个答案:

答案 0 :(得分:1)

您应该使用RedirectMatch进行正则表达式匹配:

RedirectMatxh 301 ^/details\.html$ http://www.teambonding.com.au/activities/amazing-race-brisbane

清除浏览器缓存后再进行测试。