1、在根目录下放置.htaccess文件,内容如下:
RewriteEngine on
#RewriteBase /
RewriteCond %{REQUEST_URI} !^/media/
RewriteCond %{REQUEST_URI} !^/skin/
RewriteCond %{REQUEST_URI} !^/js/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php
2、修改/etc/httpd/conf/httpd.conf中的目录权限
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory “/var/www/html”>
Options FollowSymLinks
AllowOverride All
</Directory>
3、重启apache
/etc/init.d/httpd restart