obeckham 发表于 2018-11-29 08:43:38

discuz7记录下url静态化的apache2.2配置

打开apache的配置文件,找到下面这句

http://blog.运维网.com/xcf007/images/editer/InBlock.gifLoadModule rewrite_module modules/mod_rewrite.so

把前面的注释#去掉,

按照dz7的用户手里指示,把下面这段加到httpd.conf里:
http://blog.运维网.com/xcf007/images/editer/InBlock.gif
http://blog.运维网.com/xcf007/images/editer/InBlock.gif    RewriteEngine On
http://blog.运维网.com/xcf007/images/editer/InBlock.gif    RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$
http://blog.运维网.com/xcf007/images/editer/InBlock.gif
$1/archiver/index.php?$2
http://blog.运维网.com/xcf007/images/editer/InBlock.gif    RewriteRule ^(.*)/forum-(+)-(+)\.html$ $1/forumdisplay.php?
http://blog.运维网.com/xcf007/images/editer/InBlock.gif
fid=$2&page=$3
http://blog.运维网.com/xcf007/images/editer/InBlock.gif    RewriteRule ^(.*)/thread-(+)-(+)-(+)\.html$
http://blog.运维网.com/xcf007/images/editer/InBlock.gif
$1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3
http://blog.运维网.com/xcf007/images/editer/InBlock.gif    RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3
http://blog.运维网.com/xcf007/images/editer/InBlock.gif    RewriteRule ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2
http://blog.运维网.com/xcf007/images/editer/InBlock.gif


重启apache服务器,现在我的论坛支持url静态化了。

http://localhost/dz7/forum-6-1.html



页: [1]
查看完整版本: discuz7记录下url静态化的apache2.2配置