鼠標移到頂部菜單的“設置”,點擊永久鏈接:
開啟偽靜態,並設置偽靜態路徑規則:
文章路徑個性化定義:/archives/{cid}.html
獨立頁面路徑:/{slug}.html
分類路徑:/category/{slug}.html
Linux下Apache 環境(.htaccess)
<IfModule mod_rewrite.c>
RewriteEngine On
# 下面是在根目錄,文件夾要修改路徑
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
Linux下Nginx 環境(nginx.conf)
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-e $request_filename){
rewrite (.*) /index.php;
}
Windows下IIS 環境(httpd.ini)
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# 中文tag解決
RewriteRule /tag/(.*) /index\.php\?tag=$1
# sitemapxml
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# 內容頁
RewriteRule /(.*).html /index.php/$1.html [L]
# 評論
RewriteRule /(.*)/comment /index.php/$1/comment [L]
# 分類頁
RewriteRule /category/(.*) /index.php/category/$1 [L]
# 分頁
RewriteRule /page/(.*) /index.php/page/$1 [L]
# 搜索頁
RewriteRule /search/(.*) /index.php/search/$1 [L]
# feed
RewriteRule /feed/(.*) /index.php/feed/$1 [L]
# 日期歸檔
RewriteRule /2(.*) /index.php/2$1 [L]
# 上傳圖片等
RewriteRule /action(.*) /index.php/action$1 [L]