MakingWare apache .htaccess rewrite规则编写及伪静态设置

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



发表评论

电子邮件地址不会被公开。