我有一个有博客页面的wordpress网站。
因此,对于这个页面,Url有些类似于http://abc.com/blog。
但是我想把这个url转换成http://blog.abc.com
我在.htaccess文件中添加了代码,但是重写不起作用。在apache中也有重写模式。
有人知道怎么换这个网址吗?
我想先在我的本地沼泽地测试,所以如果可能的话,请与本地主机提供建议。
密码是我试过
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc\.com/blog [NC]
RewriteRule http://blog.abc [R=301,L]发布于 2013-10-04 15:05:43
你的规则需要看起来像:
RewriteCond %{HTTP_HOST} ^abc\.com$ [NC]
RewriteRule ^blog/(.*)$ http://blog.abc.com/$1 [R=301,L]%{HTTP_HOST}变量只是主机名,其中没有路径信息(例如,/blog)。RewriteRule至少接受两个参数:
RewriteRule <pattern to match against the URI> <if matched, rewrite/redirect to this URL> <flags>https://stackoverflow.com/questions/19184552
复制相似问题