一、C:\Windows\System32\drivers\etc\hosts
找到上面的路径增加下面的一行代码,只是对原来的文件添加一行,不需要删除任何原来的!
127.0.0.1 test.shequ.com
二、D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
以下配置要搞清楚wamp的安装路径,thinkphp的存放路径,servername要和上面的hosts新添加的名字一致。双号引复制到代码中以后要重新改成英文的双引号
ServerName test.shequ.com
DocumentRoot “D:/wamp/www/thinkphp/”
Options Indexes FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from all
DocumentRoot “d:/wamp/www/”
ServerName localhost
ServerAlias localhost
三、D:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
找到上面的文件,把513行的代码或者搜索httpd-vhosts.conf关键词,把前面的井号去掉。
Include conf/extra/httpd-vhosts.conf
<h2 class="post-title"><a href="http://www.ichenhe.com/2016/07/25/thinkphp-rewrite/">ThinkPHP 中实现 Rewrite 模式</a></h2>
<div class="post-content">
1。确认httpd.conf配置文件中加载了mod_rewrite.so 模块,加载的方法是去掉mod_rewrite.so前面的注释#号
2。把httpd.conf中的Allowoverride <wbr /> <wbr />None 将None改为All
3。打开对应的项目配置文件,我的项目配置文件是Myapp/Conf/config.php ,在这个配置文件数组中增加一行,‘URL_MODEL’=>2
4。在项目的根目录下面建立一个.htaccess文件,里面写入下面的内容:
<IfModule rewrite_module>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
</div>
559

被折叠的 条评论
为什么被折叠?



