标签:
httpd.conf
找到DocumentRoot 将路径更改为项目根目录
然后在项目根目录中新建一个.htaccess文件,加入以下代码
<ifmodule mod_rewrite.c> RewriteEngine On RewriteCond %{QUERY_STRING} ^(.*) RewriteRule ^([a-z]{2,10})/$ /index.php?controller=$1&%1 RewriteCond %{QUERY_STRING} ^(.*) RewriteRule ^([a-z]{2,10})\/([a-z]{1,20})/$ /index.php?controller=$1&action=$2&%1 </ifmodule>
当访问localhost:9090/index/index/时,等同于访问localhost:9090/index.php?controller=index&action=index
标签:
原文地址:http://www.cnblogs.com/CyLee/p/5565152.html