WordPress在IIS下设置固定链接实现真正的伪静态方法

wordpress固定链接设置在新建网站的时候特别重要,因为它对SEO起到很好的作用。但是WordPress在IIS主机设置固定链接时,老会提示404错误。

需要:

第一步:服务器上已经安装好了Helicon ISAPI_Rewrite3
第二步:在IIS网站上安装ISAPI筛选器,配置:
在这里插入图片描述
第三步:把以下代码保存为httpd.ini,传到web根目录

[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default.ida|root.exe|..).* . [F,I,O]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
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]

第四步:配置Wordpress的固定链接
一般企业或资讯类的站建议这样:/%cagtegory%/%postname%.html

在这里插入图片描述

以上配置亲测可用!但不支持中文Url。
我个人也不喜欢中文Url,就这样吧:)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值