【发布时间】:2016-07-20 06:57:32
【问题描述】:
我有一个域名:
example.com
带有子域:
blog.example.com
最初在主域而不是子域中处理的所有博客。但现在我已将它们移至文件夹“博客”。
以及之前的博客链接:
example.com/123/blogcontent1
example.com/458/blogcontent2
.......
.......
example.com/458/blogcontentn
我的问题是如何编写 htaccess 规则,这样,每当域 名称/“数字”附加将它们重定向到子域,如下所示 示例:
example.com/123/blogcontent1 -> blog.example.com/123/blogcontent1
example.com/458/blogcontent2 -> blog.example.com/458/blogcontent2
还有, 我已经检查了以下帖子,但它们不是有条件的,正如我的问题所述,
Redirect directory to a subdomain
How do I redirect domain to subdomain using htaccess?
如果有帮助的话会很有用。谢谢
【问题讨论】:
标签: php apache .htaccess redirect