<var id="hn7fd"></var>
<var id="hn7fd"><strike id="hn7fd"><progress id="hn7fd"></progress></strike></var>
<cite id="hn7fd"></cite>
<var id="hn7fd"><video id="hn7fd"></video></var><cite id="hn7fd"><strike id="hn7fd"></strike></cite><var id="hn7fd"></var><cite id="hn7fd"></cite>
<var id="hn7fd"><strike id="hn7fd"></strike></var>
<var id="hn7fd"><dl id="hn7fd"><progress id="hn7fd"></progress></dl></var>
<var id="hn7fd"><strike id="hn7fd"></strike></var><menuitem id="hn7fd"><dl id="hn7fd"><progress id="hn7fd"></progress></dl></menuitem>
<var id="hn7fd"></var>

WordPress偽靜態規則設置

偽靜態:即網站本身是動態網頁如.php、.asp、.aspx等格式,而這類網頁還帶“?”加參數來讀取數據庫。開啟偽靜態后,動態網頁即被轉換重寫成靜態網頁類型頁面。

WordPress和其它網站系統不一樣,其它網站系統基本都帶有生成靜態頁面功能。但Wp只能使用偽靜態。

現在的主機基本都會支持偽靜態功能,只需在空間后臺偽靜態功能,選擇網站系統,空間就會支持該系統的偽靜態。

如何判讀空間是否支持偽靜態。在網站后臺:設置-固定鏈接,選擇第一個除外,看網站其它頁面是否出現404,如果是,則空間不支持偽靜態。

rg

只要空間支持偽靜態重寫URL Rewrite功能,根據服務器主機空間環境,只需加入下列偽靜態規則即可。

1、Apache偽靜態規則

新建一個 txt 文件,將下面的代碼添加到文件中,然后另存為.htaccess文件,上傳到WordPress站點的根目錄即可。

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

2、Nginx規則

在Nginx中的server模塊配置如下內容,打開 nginx.conf 或者某個站點的配置環境,例如 /usr/local/nginx/conf/yzipi.conf,在server{ } 大括號里面添加下面的代碼。

location / {

if (-f $request_filename/index.html){

rewrite (.*) $1/index.html break;

}

if (-f $request_filename/index.php){

rewrite (.*) $1/index.php;

}

if (!-f $request_filename){

IIS偽靜態規則rewrite (.*) /index.php;

}

}

3、IIS偽靜態規則

新建一個 txt 文件,將下面的代碼添加到文件中,然后另存為 httpd.ini 文件,上傳到WordPress站點的根目錄即可。

[ISAPI_Rewrite]

# Defend your computer from some worm attacks

#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

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

# from accessing through HTTP

# Rules to ensure that normal content gets through

RewriteRule /tag/(.*) /index\.php\?tag=$1

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

RewriteRule /images/(.*) /images/$1 [L]

RewriteRule /sitemap.xml /sitemap.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]

本文由網上采集整理發布,不代表本站觀點和立場,如有侵權請告知本站刪除,本站不負任何責任和承諾。如若轉載,請注明原文和注明出處:http://www.ddcaps.com/wangzhandajian/wordpressjianzhan/3164.html

(4)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
上一篇 2021-08-11 20:11
下一篇 2021-08-11 20:21

相關推薦

發表評論

登錄后才能評論
QQ

流量合作還是咨詢SEO服務,請注明來意!謝謝!

在線咨詢:點擊這里給我發消息消息

郵件:1048285234@qq.com

在線時間:周一至周五,10:00-22:00

微信
微信
分享本頁
返回頂部
你懂的网址在线,你懂的网址在线观看,你懂的无码视频在线观看,你懂的小电影,你懂的小视频 <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>