利用.htaccess的Rewrite规则实现Discuz论坛的伪静态链接
<p>在后台开启了“URL Rewrite”,看起来一切正常,可是点击某一栏目的时候却怎么都进不去,显示的依然是论坛的首页。看了一下论坛目录下,原来这下面并没有自己的.htaccess文件,所以默认使用的应该是Godaddy主机的.htaccess,而默认的肯定不会有针对Discuz的Rewrite规则,所以加入了下面的语句,一切都正常了~</p>
<p>
<span><u>复制代码</u></span> 代码如下:</p>
<p>
<br>
RewriteEngine On<br>
RewriteBase /<br>
RewriteRule ^archiver/(+\.html)$ archiver/index.php?$1<br>
RewriteRule ^forum-(+)-(+)\.html$ forumdisplay.php?fid=$1&page=$2<br>
RewriteRule ^thread-(+)-(+)-(+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2<br>
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2<br>
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2<br>
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1</p>
<p>
<br>
注:倒数第二行是针对Discuz的SupeSite/X-Space,我并没有安装,实际上并不需要。</p>
頁:
[1]