投稿 评论 顶部

Windows虚拟主机完美实现wordpress伪静态终极方法

佚名 网络安全

?1,比如效果链接:http://www.jx166.com/80.html
所以就要在wordpress后面的固定链接—选择自定义—填上(“/%post_id%.html”),注意后面的分类目录前辍与标签前辍不要改变,保持空白。
2,分类目录是:链接:http://www.jx166.com/category/youhui
所以必须在分类目录的别名里面填上youhui,注意,别名一定要填上,而且要填写英文或拼音。
接下来,我们就要为我们的根目录下面创建一个文件httpd.ini,具体内容如下,最好不要改变,如果你不是很熟悉的话,不然会出很多错误哦。
[ISAPI_Rewrite]
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# # 形式:/PostID.html
# # 自定义链接 /%post_id%.html
RewriteRule /wp-(.*) /wp-$1 [L]
RewriteRule ^/$ /index\.php [L]
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(about|contact|about-copyright|favor|diy|archives|tags|sitemap|link|search|help|security|%e5%85%b3%e4%ba%8e)
/index\.php\?pagename=$1
RewriteRule /(search) /\?pagename=$1
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|love|diy|talk|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/?(.*) /index\.php\?category_name=$1
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
RewriteRule /author/?(.*) /index\.php\?author_name=$1
RewriteRule /rss.xml /wp-feed\.php/\?feed=rss2
RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /feed/?$ /index\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
RewriteRule /([0-9]+).html /index\.php\?p=$1 [I]
RewriteRule /page/(.*)/ /index\.php\?paged=$1
RewriteRule /date/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?
year=$1&monthnum=$2&day=$3&name=$4&page=$5
RewriteRule /date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1
RewriteRule /([0-9]+).html/trackback /wp-trackback\.php\?p=$1
注意细节:文件保存为ANSI格式。

相关文章:虚拟主机如何设置伪静态规则