1、首先设置服务器的时候设置伪静态
在 Include etc/httpd.conf中将
<Directory />
AllowOverride none
Require all denied
</Directory>
改成
<Directory />
#AllowOverride none
#Require all denied
Order deny,allow
Allow from all
</Directory>
2、在Include etc/extra/httpd-vhosts.conf中设置
<VirtualHost *:8888>
ServerName localhost
Documentroot "/Users/**/project/web"
RewriteEngine on
#开启Rewrite模块
RewriteRule (.*)\.(jpg|jpeg|jpe|gif|bmp|png|wma|mp3|wav|avi|mp4|flv|swf)$ https://www.baidu.com [R=301,L,NC]
</virtualHost>
<Directory "/Users/**/project/web">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
注意documentroot中的文件两边双引号一定要是英文
3、如果是smaryt权限问题smarty不能写文件的时候,将mac中的文件夹的权限递归设置一下