武汉SEO
时光静好,与君语;细水流年,与君同;繁华落尽,与君老...

wordpress>正文

WordPress伪静态规则分享(window环境)

2014-05-28 11:15

[ISAPI_Rewrite]

# 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 /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]

    把此代码复制一份放到一个新建的txt中。把txt命名为httpd.ini 上传至网站根目录下。测试可以正常使用。

 

方法二:

[ISAPI_Rewrite] 
# 3600 = 1 hour 
CacheClockRate 3600 
RepeatLimit 32 
# Protect httpd.ini and httpd.parse.errors files 
# from accessing through HTTP 
RewriteCond Host: ^leadkj.com$
RewriteRule (.*) http://www.leadkj.com$1 [I,RP]
# Rules to ensure that normal content gets through 
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]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

把此代码复制一份放到一个新建的txt中。把txt命名为httpd.ini 上传至网站根目录下。里面包含301跳转。

注意:后台固定链接自定义结构设置为 /archives-%post_id%.html   即可

本文链接:https://www.0937.biz/post-151.html