松江生活网全新改版为令升网络,网址不变,QQ群不变(群1:171943922,群2:283136722)!

wordpress5+iis7.5伪静态规则写法,tags标签不再有404问题

网站建设 lingsheng 3807℃ 0评论

最近有一个朋友使用iis7.5搭建wordpress遇到了伪静态的问题,弄了半天,头疼的要死,前台标签tagurl访问或者后台编辑分类目录与标签一直出现404,找对方法是最重要的,网上的很多东西都已经过时了,要么是3.0时代的版本,要么一直在说tag中文导致404的问题,其实就是伪静态的问题导致的。

下面就把最新的方法告诉大家吧,iis7.5及以上版本通用,你需要在本地建立一个web.config然后将一下内容复制进去。

<?xml version=”1.0″ encoding=”UTF-8″?>

<configuration>

<system.webServer>

<rewrite>

<rules>

<rule name=”category”>

<match url=”category/?(.*)” />

<conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />

<action type=”Rewrite” url=”/index.php?category_name={R:1}” appendQueryString=”false” logRewrittenUrl=”false” />

</rule>

—–以下tags的伪静态规则你需要删除,否则还是会出问题,大家可以试一试加上和去掉的变化——

<rule name=”tags”>

<match url=”tag/?(.*)” />

<conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />

<action type=”Rewrite” url=”index.php?tag={R:1}” />

</rule>

—————————————————————————————

<rule name=”Main Rule” stopProcessing=”true”>

<match url=”.*” />

<conditions logicalGrouping=”MatchAll” trackAllCaptures=”false”>

<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />

<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />

</conditions>

<action type=”Rewrite” url=”index.php/{R:0}” />

</rule>

<rule name=”wordpress” patternSyntax=”Wildcard”>

<match url=”*” />

<conditions logicalGrouping=”MatchAll” trackAllCaptures=”false”>

<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />

<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />

</conditions>

<action type=”Rewrite” url=”index.php” />

</rule></rules>

</rewrite>

</system.webServer>

</configuration>

编辑好后上传到你的网站根目录就可以了,大家遇到到404之后一定要看下自己的iis版本是多少,然后再去百度搜索寻找正确的解决方法,盲目的查找只会浪费大家时间和精力。

伪静态写好之后就可以开始你的seo优化之旅了。

转载请注明:令升网络 » wordpress5+iis7.5伪静态规则写法,tags标签不再有404问题

喜欢 (0)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(2)个小伙伴在吐槽
  1. I think that what you published was very logical. But, what about this? what if you added a little content? I am not saying your information isn't good., but suppose you added a title that makes people want more? I mean wordpress5+iis7.5伪静态规则写法,tags标签不再有404问题-令升网络 is kinda vanilla. You should glance at Yahoo's front page and see how they create news titles to grab people interested. You might add a related video or a pic or two to get people excited about everything've got to say. In my opinion, it might make your posts a little bit more interesting.
    Trimble zephyr2019-05-18 13:04 回复
    • you thinking is very good,title is very import about SEO, I will improve it in the future. 对于添加感兴趣的视频或者图片目前还是做不到哦
      lingsheng2019-05-25 23:36 回复