htaccess 将所有请求从子文件夹重定向到子域
我有以下 (WordPress) URL 规范结构:
http://mysite.com/2011/10/my-post-name/
我想从 http:// 发送所有请求mysite.com/2011/...
到子域上的同一位置。
具体来说应该是:
http://mysite.com/2011/10/my-post-name/
---> http://subdomain.mysite.com/2011/10/my-post-name/
我不确定正确的语法是什么,有人知道吗?
I have the following (WordPress) URL canonical structure:
http://mysite.com/2011/10/my-post-name/
I want to send all requests from http://mysite.com/2011/...
down to the same location on a subdomain.
So specifically that should be:
http://mysite.com/2011/10/my-post-name/
---> http://subdomain.mysite.com/2011/10/my-post-name/
I'm not sure what the correct syntax is for this, does anyone know?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您还需要匹配路径的第一部分,则使用
您应该阅读 mod_rewrite 文档。第一次会让人感到困惑,但是大约 25 次之后,它就会变得很有意义并且对你很有帮助。
If you also need to match the first part of the path, then use
You should read the mod_rewrite documentation. It's confusing the first time, but after the 25th time or so it will make pretty good sense and serve you well.