【发布时间】:2011-04-23 08:58:44
【问题描述】:
我有这个地址http://www.example.com 和这个页面http://www.example.com/world。 我可以用 mod_rewrite 做到这一点,我的页面变成 http://world.example.com 吗? 任何链接,教程,...,会很好,如果我能做到这一点? 例如,这些链接将是什么:
http://www.example.com/world/some-other-page
http://www.example.com/world/and-second-apge
这些链接是否也会被重写为:
http://world.example.com/some-other-page
http://world.example.com/and-second-apge
另一个问题,这对 SEO 有好处吗?
对不起,我的英语不好。
【问题讨论】:
-
尝试将以下内容添加到感兴趣目录上方父目录中的
.htaccess:RedirectMatch ^/foo/$ /foo/bar/或RedirectMatch ^/foo/$ /bar/baz/。另见How to get apache2 to redirect to a subdirectory。
标签: apache mod-rewrite