如何使用 htaccess 将 www 网址重定向到非 www 网址?
我想知道如何将用户从 http://www.mysite.com 重定向到 http://mysite.com 使用 htaccess,我不熟悉如何操作此文件来执行此操作,任何人都可以帮助我完成此操作?
提前致谢。
I wanted to know how to redirect users from http://www.mysite.com to http://mysite.com using htaccess, I'm not familiar in how to manipulate this file in order to do this, can anyone help me accomplish this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这个网站给出了完整的答案:
它是当我用谷歌搜索它时出现的第一件事,所以我假设你甚至没有费心去寻找答案(顽皮的孩子,啧,啧!)。
This site gives a complete answer:
It was the first thing that appeared when I googled for it, so I assume you didn't even bother to look for an answer (naughty boy, tsk, tsk!).
这个网站应该会有帮助:
http://enarion.net/web/htaccess/redirect-www- and-no-www/
This site should be helpful:
http://enarion.net/web/htaccess/redirect-www-and-no-www/
只需添加以下内容:
Just add this:
像这样的东西应该可以解决
你想要谷歌“htaccess rewrite”以找到更多信息的技巧
something like this should do the trick
you want to google for "htaccess rewrite" to find more info about it