- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務(wù)經(jīng)營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會理事單位
- 安全聯(lián)盟認證網(wǎng)站身份V標(biāo)記
- 域名注冊服務(wù)機構(gòu)許可:滇D3-20230001
- 代理域名注冊服務(wù)機構(gòu):新網(wǎng)數(shù)碼
wordpress默認的鏈接是動態(tài)的形式,大家都喜歡搞搞SEO,變換下鏈接地址,于是wordpress偽靜態(tài)就登場了。偽靜態(tài)的鏈接更具有層級結(jié)構(gòu)關(guān)系,更有利于蜘蛛抓取,不同的web環(huán)境偽靜態(tài)鏈接規(guī)則也不一樣,整理了幾種,方便大家參考。 apache環(huán)境下的wordpress偽靜態(tài)規(guī)則
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
新建一個.htaccess文件并將以上代碼寫入.htaccess文件中,上傳至wordpress站點的根目錄中。 IIS環(huán)境下的wordpress偽靜態(tài)規(guī)則 方法1、打開站點根目錄下的web.config文件并加入以下代碼:
<rulename="Main Rule"stopProcessing="true"> <matchurl=".*"/> <conditionslogicalGrouping="MatchAll"> <addinput="{REQUEST_FILENAME}"matchType="IsFile"negate="true"/> <addinput="{REQUEST_FILENAME}"matchType="IsDirectory"negate="true"/> <actiontype="Rewrite"url="index.php/{R:0}"/>
方法2、新建一個httpd.ini文件并加入以下代碼:
[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 /sitemap.xml.gz /sitemap.xml.gz [L] RewriteRule /robots.txt /robots.txt [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]
上傳至wordpress站點根目錄。
nginx環(huán)境下的wordpress偽靜態(tài)方法
location / { index index.html index.php; 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){ rewrite (.*) /index.php; } }
將以上代碼加入到nginx.conf文件的Server段內(nèi)。 這是目前比較流行的幾種web配置的偽靜態(tài)規(guī)則。
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP