• kerrylee2012

    (@kerrylee2012)


    声明:首先非常欢迎您转载这篇文献,请一定要带上原文地址。一方面是尊重作者劳动成果,作者对它付出的代价是你难以想象的;另一方面是有效集中原文权重,这样从SEO角度才可以让更多的人发现它
    之前写过两篇关于设置wordpress伪静态的文章分别是通过404在Win环境实现wordpress伪静态和通过web.config在Win环境实现wordpress伪静态,最后我还是采用了本文章所讲的方法对wordpress实现伪静态了,这个方法也算最完美的。
    采用404错误页面实现伪静态对wordpress固定链接不友好,从而影响到文章的翻页效果,所以我放弃了。使用web.config文件实现伪静态必须要在IIS7以及以上版本才有效。下面我说一下通过WordPress伪静态规则在Windows环境下实现伪静态的方法:
    ————————————————————————————————————-
    1.新建一个记事本文件,将文件名改为:httpd.ini。再将以下代码粘贴进去。
    [ISAPI_Rewrite]
    # 3600 = 1 hour
    CacheClockRate 3600 RepeatLimit 32
    # Protect httpd.ini and httpd.parse.errors files
    # from accessing through HTTP # wordpress
    # For tag RewriteRule /tag/(.*)/page/(\d+)$ /index\.php\?tag=$1&paged=$2
    RewriteRule /tag/(.+)$ /index\.php\?tag=$1
    # For category RewriteRule /category/(.*)/page/(\d+)$ /index\.php\?category_name=$1&paged=$2
    RewriteRule /category/(.*) /index\.php\?category_name=$1
    # For sitemapxml 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]
    2.将httpd.ini上传至服务器根目录或wordpress根目录。
    3.在固定连接中修改你想要的网址格式。

    再次感谢魔尊博客提供的帮助!
    ————————————————————————————————————-
    到这里并没有结束,如果你没有去掉分类目录链接中的category, 在分类目录下面依然不能实现翻页功能,非常感谢小赖收藏夹提供插件wp-no-category-base去掉分类目录链接中的category。

    本文固定链接: http://www.kerry86.com/482.html | 合肥SEO

  • 话题 ‘wordpress伪静态规则,win环境完美解决方案’不再接受新回复。