開啓文件(去掉註釋): Include /private/etc/apache2/extra/httpd-vhosts.conf
php
開啓文件:(沒有則添加) LoadModule rewrite_module modules/mod_rewrite.so
thinkphp
將AllowOverride none 改成 AllowOverride All
apache
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents/tp/public/"
ServerName tptest.com
ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
<Directory "/Library/WebServer/Documents/tp/public">
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
複製代碼
添加:127.0.0.1 tptest.com
瀏覽器
重啓:sudo apachectl restart
bash
啓動:sudo apachectl start架構
實際訪問的是:http://tptest.com/index.php/index/index/index
框架
等價於:http://tptest.com/index.php?m=index&c=index&a=index
iview