WordPress伪静态设置 (win主机伪静态规则 )

puppy

WordPress伪静态设置规则,301重定向设置方法(win主机)

本站空间为win主机,关于伪静态和301重定向问题,研究了好长时间终于好了。现在共享给win主机的同学。
win主机伪静态和301重定向都需要用到httpd.ini文件,上传到网站根目录。
(有httpd.ini文件的修改,没有的直接新建)
先上完整代码:

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

RewriteCond Host: ^yhaow.com$

RewriteRule (.*) http://blog.yhaow.com$1 [R,I]

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

WP伪静态说明:
需要在wordpress后台 设置→固定连接→自定义为 /%category%/%postname%.html
[toggle title=”固定连接参数”]%year%:基于文章发布的年份;
%monthnum%:基于文章发布的月份;
%day%:基于文章发布当日;
%hour%:基于文章发布小时数;
%minute%:基于文章发布分钟数;
%second%:基于文章发布秒数;
%postname%:基于文章的postname,其值为撰写时指定的缩略名,不指定缩略名时是文章标题;
%post_id%:基于文章post_id;
%category%:基于文章分类,子分类会处理成“分类/子分类”这种形式;
%author%:基于文章作者名。[/toggle]
[toggle title=”网上常见的几种设置方法”]/%year%/%monthnum%/%day%/%postname%/
/%year%/%monthnum%/%postname%/
/%year%/%monthnum%/%day%/%postname%.html
/%year%/%monthnum%/%postname%.html
/%category%/%postname%.html
/%post_id%.html
本站采用/%post_id%.html格式,个人觉得简单[/toggle]

301重定向说明:

以本站为例:需要把ainiseo.com重定向到www.ainiseo.com

代码如下:

RewriteCond Host: ^ainiseo.com$ RewriteRule (.*) http://www.ainiseo.com$1 [R,I] 以上代码,请根据你的网站自行修改。


相关推荐
  • WordPress 建站教程,如何快速建站?
  • 为什么你很努力,SEO效果仍是不明显?
  • SEO效果监控级别策略
  • 百度蜘蛛的IP路线大全,帮你分析网站日志
  • SEO优化趋势如何 seo优化怎么做
  • 系统推荐
  • WordPress伪静态设置 (win主机伪静态规则 )
  • WordPress 升级后无法切换到文本模式
  • 撰写搜索引擎喜欢的标题
  • 百度seo问答篇
  • 网站被黑问题解决方法1

  • puppy

    官方运营-Sean丶♥

    5183 SEO文章 文章

    评论