鑑於 X2 的 URL 靜態化在原有的基礎新增了一些規則,導致論壇上有人反映 URL 靜態化頁面失效。

特此補充一下靜態化規則 (在原有的基礎上新增,為了防止衝突,請新增到原有規則之前):

使用 Apache 2.x 的虛擬使用者在相應的配置檔案在原有的規則下新增:

  1. RewriteCond %{QUERY_STRING} ^(.*)$
  2. RewriteRule ^blog-([0-9]+)-([0-9]+).html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
  3. RewriteCond %{QUERY_STRING} ^(.*)$
  4. RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1
  5. RewriteCond %{QUERY_STRING} ^(.*)$
  6. RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1

使用 IIS 的使用者在相應的配置檔案原有的規則下新增:

  1. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+).html(?(.*))*$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&$5
  2. RewriteRule ^(.*)/topic-(.+).html(?(.*))*$ $1/portal.php?mod=topic&topic=$2&$4
  3. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+).html(?(.*))*$ $1/portal.php?mod=view&aid=$2&page=$3&$5

使用 nginx 的使用者在相應的配置檔案原有的規則下新增:

  1. rewrite ^([^.]*)/blog-([0-9]+)-([0-9]+).html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
  2. rewrite ^([^.]*)/topic-(.+).html$ $1/portal.php?mod=topic&topic=$2 last;
  3. rewrite ^([^.]*)/article-([0-9]+)-([0-9]+).html$ $1/portal.php?mod=view&aid=$2&page=$3 last;