WordPress伪静态规则大全

WordPress 如何添加伪静态规则,很多朋友咨询WordPress伪静态规则如何下,风酷seo提醒大家,这有分多种情况,跟你所用的服务器环境有绝对关系,下面就介绍 IIS/Apache/Nginx 三种环境下的伪静态规则:

WordPress伪静态规则大全

IIS伪静态规则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 /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]

 

Apache伪静态规则 .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

Nginx伪静态规则.conf

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){
 rewrite (.*) /index.php;
 }
}

转载请注明出处::【风酷seo网站优化排名公司】 » WordPress伪静态规则大全