Home  >  Article  >  Backend Development  >  这个重写规则是什么意思啊多谢

这个重写规则是什么意思啊多谢

WBOY
WBOYOriginal
2016-06-13 13:49:53917browse

这个重写规则是什么意思啊?谢谢
RewriteRule ^(/)$ %{HTTP_HOST}$1 [C]

这个不知道什么意思

------解决方案--------------------
把"/"重写成"http://yourhostname.com/",其中%{HTTP_HOST}表示主机名,$1表示第一个子模式所匹配的字符串,在这个案例中就是"/"了。至于[C]表示该条规则和下个连用,你可以去Apache官网上找到相关说明:http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn