开启文件(去掉注释): 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