六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 455|回复: 0

WINDOWS主机下WordPress伪静态配置

[复制链接]
 楼主| 发表于 2012-10-14 12:54:39 | 显示全部楼层 |阅读模式
windows主机下wordpress伪静态的配置[/url],但是这个配置有一个问题,由于采用的是通配方式,所以无法访问到wordpress程序以外的子目录.而且也会令配置的windows主机防盗链失效.
今天修改了一下以前曾经找到的一个配置,修改了一些错误做了下测试,主要功能都没问题.下面说明一下,因为根据固定链接配置的不同,配置文件内容也不同.
我的固定链接配置是:/%category%/%monthnum%-%post_id%.html 分类目录前缀 及 标签前缀 为默认.
建立httpd.ini,填写以下内容:
  1. [ISAPI_Rewrite]
  2. # Protect httpd.ini and httpd.parse.errors files
  3. # from accessing through HTTP
  4. # # 自定义链接 /%category%/%monthnum%-%post_id%.html
  5. RewriteRule /wp-(.*) /wp-$1 [L]
  6. RewriteRule ^/$ /index\.php [L]
  7. RewriteRule /tag/(.*)/page/([0-9]+) /index\.php\?tag=$1&paged=$2
  8. RewriteRule /tag/(.*) /index\.php\?tag=$1
  9. #定义自定义页面,用|隔开的是你的自定义页面的别名,最好不要用中文
  10. RewriteRule /(about|contact|contact-2|leave-message|search|about-copyright|favor|diy|archives|tags|sitemap|link|search|help|security|%e5%85%b3%e4%ba%8e) /index\.php\?pagename=$1

  11. #搜索页
  12. RewriteRule /(search)(\?.*) /index\.php\?pagename=$1
  13. #分类订阅
  14. RewriteRule /category/(.*)/(feed|rdf|rss|rss2|love|diy|talk|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
  15. #分类文章列表分页
  16. RewriteRule /category/(.*)/page/([0-9]+) /index\.php\?category_name=$1&paged=$2
  17. #分类文章列表
  18. RewriteRule /category/?(.*) /index\.php\?category_name=$1
  19. #作者订阅
  20. RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
  21. #作者文章列表分页
  22. RewriteRule /author/(.*)/page/([0-9]+) /index\.php\?author_name=$1&paged=$2
  23. #作者文章列表页
  24. RewriteRule /author/?(.*) /index\.php\?author_name=$1
  25. #Rss订阅
  26. RewriteRule /rss.xml /wp-feed\.php/\?feed=rss2
  27. #feed订阅
  28. RewriteRule /feed/?$ /index\.php/\?feed=rss2
  29. #评论订阅
  30. RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
  31. #文章页
  32. RewriteRule /(.*)/([0-9]+)-([0-9]+).html /index\.php\?p=$3 [I]
  33. #文章分页
  34. RewriteRule /(.*)/([0-9]+)-([0-9]+).html/([0-9]+) /index\.php\?p=$3&paged=$4 [I]
  35. #文章订阅
  36. RewriteRule /(.*)/([0-9]+)-([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$3
  37. #文章引用
  38. RewriteRule /(.*)/([0-9]+)-([0-9]+).html/trackback /wp-trackback\.php\?p=$3
  39. #以下暂未用到
  40. RewriteRule /page/(.*)/ /index\.php\?paged=$1
  41. 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
  42. RewriteRule /date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  43. RewriteRule /date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
复制代码
然后放置到域名指向的根目录下,然后配置一下你的wordpress固定链接. 就OK了.

本文转载自:http://www.2016k.com/wordpress/09-95.html/comment-page-1

该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表