1.编写位置.htaccess,设置文件属性为777
2.修改httpd.conf,
vi /etc/httpd/conf/httpd.conf
在
后面增加
<IFMODULE mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule category/(.*)/(.*).html$ category.php?id=$1&page=$2
RewriteRule chapter/ctx_(.*).html$ chapter_ctx.php?id=$1
RewriteRule ^t_(.*).html$ test.php?id=$1 [L]
</IFMODULE>
2.修改httpd.conf,
vi /etc/httpd/conf/httpd.conf
在
DocumentRoot "/var/www/html"
后面增加
AllowOverride All