1、如果是用虛擬主機,確認是否支持rewrite偽靜態(tài)httpd.ini文件
2、如果是VPS,請參考Windows VPS如" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

15158846557 在線咨詢 在線咨詢
15158846557 在線咨詢
所在位置: 首頁 > 營銷資訊 > 網(wǎng)站運營 > windows VPS中wordpress偽靜態(tài)規(guī)則

windows VPS中wordpress偽靜態(tài)規(guī)則

時間:2023-06-26 07:45:02 | 來源:網(wǎng)站運營

時間:2023-06-26 07:45:02 來源:網(wǎng)站運營

windows VPS中wordpress偽靜態(tài)規(guī)則:為了讓windows VPS的偽靜態(tài)生效,需要提前準備wordpress的偽靜態(tài)腳本httpd.ini文件。

1、如果是用虛擬主機,確認是否支持rewrite偽靜態(tài)httpd.ini文件
2、如果是VPS,請參考Windows VPS如何添加偽靜態(tài)這篇文章,先把偽靜態(tài)組件安裝好。我們的目的是把程序中的動態(tài)頁面鏈接都換成偽靜態(tài)的效果,比如post.php?id=123需要換成post123.html
3、在電腦上新建一個TXT文檔,復(fù)制以下內(nèi)容到文檔中。

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files

# from accessing through HTTP

# wordpress 偽靜態(tài)規(guī)則

# For tag(中文標簽以及標簽翻頁的規(guī)則)

RewriteRule /tag/(.*)/page/(/d+)$ /index/.php/tag=$1&paged=$2

RewriteRule /tag/(.+)$ /index/.php/tag=$1

# For category(中文分類以及分類翻頁的規(guī)則)

RewriteRule /category/(.*)/page/(/d+)$ /index/.php/category_name=$1&paged=$2

RewriteRule /category/(.*) /index/.php/category_name=$1

# For sitemapxml

RewriteRule /sitemap.xml /sitemap.xml [L]

RewriteRule /sitemap.html /sitemap.html [L]

RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]

RewriteRule /favicon.ico /favicon.ico [L]

# For file-based wordpress content (i.e. theme), admin, etc.

RewriteRule /wp-(.*) /wp-$1 [L]

# For normal wordpress content, via index.php

RewriteRule ^/$ /index.php [L]

RewriteRule /(.*) /index.php/$1 [L]

保持文檔后,把文檔重新命名為httpd.ini,記得把擴展名.txt改成.ini

4、去WP后臺設(shè)置固定鏈接,下面以魏艾斯博客為例子。

5、把httpd.ini文件放入網(wǎng)站根目錄中。打開網(wǎng)頁看到html頁面就證明成功了。

轉(zhuǎn)載請注明:魏艾斯博客 ? windows VPS中wordpress偽靜態(tài)規(guī)則

關(guān)鍵詞:靜態(tài),規(guī)則

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點擊下載Chrome瀏覽器
關(guān)閉