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

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] 以上代码,请根据你的网站自行修改。

本站文章由SEO技术博客撰稿人原创,作者:无 忧创作,如若转载请注明原文及出处:https://www.ainiseo.com/wordpress/955.html

(2)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2016年1月21日
下一篇 2016年1月30日

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

联系我

由于平时工作忙:流量合作还是咨询SEO服务,请简明扼表明来意!谢谢!

在线咨询:点击这里给我发消息

邮件:wuyouseo@gmail.com 合作微信:wuyoublog

工作时间:周一至周六,9:30-22:30,节假日休息

个人微信
个人微信
分享本页
返回顶部