管理资源吧

当前位置:管理资源吧首页>>>meiwen>>>c5>>>百科知识

wordpress程序怎么设置伪静态

  之前有不少的朋友问我,服务器是WIN系统的主机,怎么在wordpress程序里设置网站的伪静态,开始的时个我也不知道怎么去写,于是无去查了不少的资料,最终皇天不付有心人,让我给找到了,现这我就把这个分享出来,希望能帮到一些朋友。

  win系统下的wordpress程序伪静态的设置如下:

  wordpress在win系统下的伪静态前提是必须空间系统支持伪静态设置,而我们也知道一般win系统支持的伪静态规则为httpd.ini格式的,那我们首先就先新建一个文本文档,将以下代码复制粘贴在里面(这是我至今为止搜集到的最完美的win系统伪静态规则)。

  [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 /sitemap.html /sitemap.html [L]

  RewriteRule /sitemap_baidu.xml /sitemap_baidu.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]

  将以上代码复制粘贴到文本文档后,我们再将文本另存为httpd.ini,这样我们的伪静态规则就弄好了,我们只需要将这个文件上传到空间更目录,如果在后台→固定链接选择自定义链接输入/%category%/%post_id%.html或是/%post_id%.html点击保存就可以了,这里面我们还需要一个插件的支持,那就是去除分类URL中间的category,我们只需要在后台插件→安装插件那搜索WP No Category Base,安装启用就可以了。这样我们win系统下的wordpress程序伪静态就完成了。

  以上的方法是我自己亲身使用过的,是很完美的伪静态设置方法,这样对网站的优化是很我帮助,大大提高了搜索引擎对网站的搜索。

  除非注明,文章均为重庆SEO原创,转载请注明本文地址:http://www.lefengseo.com/167.html

meiwen首页 更多meiwen