关于url重写
/* 开启rewrite模块 */
rewriteengine on
/*对于来自于“admin.gb.cn”域名进入的 */
rewritecond %{http_host} admin.gb.cn [nc]
/*如果文件存在,就直接访问文件,不进行下面的rewriterule.*/
rewritecond %{request_filename} !-f
/*将转入admin.php */
rewriterule ^(.*)$ admin.php [l]
/*如果文件存在,就直接访问文件,不进行下面的rewriterule.*/
rewritecond %{request_filename} !-f
/*将转入index.php */
rewriterule ^(.*)$ index.php [l]
这是我写的注释,我不知道对不对。另外问个问题
{http_host} 是域名么。。 那%{http_host} 是什么
还有就是
我理解啊。前面一段是admin的入口,后一段是www的入口。那为什么www的
不需要rewritecond %{http_host} www.gb.cn [nc]??来做限制呢
------解决方案--------------------
这就如同 if else 结构一般
符合条件的走 true 分支,不符合条件的都走 false 分支
www.gb.cn、xxx.gb.cn 都不符合 admin.gb.cn,又没有其他需求。于是就都
rewriterule ^(.*)$ index.php