.htaccess 将子域重定向到主站点 - 没有例外
我正在尝试将 subdomain.example.com 的所有请求重定向到 www.example.com
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
似乎会导致 500 内部服务器错误,
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
所以我的问题是为什么这些失败以及如何修复它?
I'm trying to redirect all requests for subdomain.example.com to www.example.com
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Seems to cause a 500 internal server error as does
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
So my question is why are these failing and how do I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在前两行之后添加:
After your first two lines, add: