HTACCESS 编辑的重定向问题

发布于 2024-09-10 14:15:43 字数 239 浏览 0 评论 0原文

重写引擎开启 RewriteCond %{HTTP_HOST} ^tsgcs.ca$ RewriteRule (.*) http://www.tsgcs.ca/$1 [R=301,L]

这给了我错误“Firefox 已检测到服务器正在以永远不会完成的方式重定向对此地址的请求。”

有什么想法吗?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^tsgcs.ca$
RewriteRule (.*) http://www.tsgcs.ca/$1 [R=301,L]

This is giving me errors 'Firefox has detected that the server is redirecting the request for this address in a way that will never complete.'

Any ideas why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

念﹏祤嫣 2024-09-17 14:15:43

您正尝试将 URL 的非 www 版本重定向到 www 版本。几乎是正确的,但是 RewriteRule 中的匹配不太正确。看一下这里的示例:

http://www.webweaver.nu/html -tips/web-redirection.shtml

You're trying to redirect the non-www version of a URL to the www version. It's almost correct, but the matching in the RewriteRule isn't quite right. Take a look at the examples here:

http://www.webweaver.nu/html-tips/web-redirection.shtml

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文