首页 > 代码库 > 使用phpnow本地搭建Discuz!如何实现伪静态

使用phpnow本地搭建Discuz!如何实现伪静态

用phpnow本地搭建Discuz!如何实现伪静态因为phpnow本身就支持伪静态,那只要看下相关的设置是否正确,写个.htaccess的文件就可以了。一.确认httpd.conf的设置在xxx\Apache-22\conf路径下找到httpd.conf,查找“rewrite”,确保开启了rewrite模块,即 “LoadModule rewrite_module modules/mod_rewrite.so”这一顶前面没有#号。PHPnow默认是开启的。二.建一个.htaccess文件新建个.htaccess文件放到网站的根目录。下面是代码:RewriteBase /RewriteEngine OnRewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^thread-([0-9]+)-([0-9]+)-1\.html$ forum.php?mod=viewthread&tid=$1&extra=page\={prevpage}&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=http://www.mamicode.com/$2&%1>

  

使用phpnow本地搭建Discuz!如何实现伪静态