24 2008

ubuntu 6.06+LAMP+discuz6.0 启用URL静态化配置

Published by at 12:29 under Linux/Unix,服务器

安装discuz6.0后,启用URL静态化的步骤(本人使用的是apache的虚拟主机):

1。由于ubuntu6.06中使用apt安装的apache默认不启用mod_rewrite 模块,需要启用:

命令:sudo a2enmod rewrite

之后在/etc/apache2/mods-enabled下面已有rewrite.load文件就可以看到

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

2。在/etc/apache2/sites-enabled中编辑需要打开的虚拟主机文件,

示例如下:

<VirtualHost *:80>
    ServerAdmin
noname@gmail.com
    DocumentRoot /www/html/scripts
    ServerName scripts.zeali.net
    ErrorLog /logs/scripts.zeali.net-error_log
    CustomLog /logs/scripts.zeali.net-access_log common
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/archiver/((fid|tid)-[w-]+.html)$ $1/archiver/index.php?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3
RewriteRule ^(.*)/space-(username|uid)-(.+).html$ $1/space.php?$2=$3
RewriteRule ^(.*)/tag-(.+).html$ $1/tag.php?name=$2
</IfModule>
</VirtualHost>

3。激活这个虚拟主机设置

命令:sudo a2ensite xxx

4。重启apache

这时候,discuz的静态化已经可以使用了~

No responses yet

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.