用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 On RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^thread-([0-9]+)-([0-9]+)-1\.html$ forum.php?mod=viewthread&tid=$1&extra=page\={prevpage}&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1