如何解决重定向URL和.htaccess并重写规则出错
我正在尝试通过.htaccess将http:// localhost / anay-bose重定向到http://localhost/anay-bose/1338.html(实际和有效网址)
这是我的规则:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9])$ /anaybose/$1 [R=301]
Redirect /anay-bose http://localhost/anay-bose/1338.html
问题是它重定向到诸如http://localhost/anay-bose/1338.html/1338.html/1338.html/1338.html/1338.html/1338.html/1338.html/ 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338.html / 1338。 html
很多1338.html,而我只需要一个1338.html
寻找见识。
解决方法
对其进行一些增强
RedirectMatch ^/anay-bose$ http://localhost/anay-bose/1338.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。