空间迁移后,WordPress文章中所有的中文tag页面访问全都报404错误,Google搜索了一下,得知IIS7.5伪静态URL_Rewrite不支持中文,最终在IIS7 WordPress 中文 URL 解决方案博文中找到解决方法,特别感谢原文作者,在此将解决方案再分享一下,希望可以帮到后来的朋友~
在WordPress安装目录下,新建一个“chineseurl.php”文件,内容如下:
| 代码如下 | 复制代码 |
|
<?php // IIS Mod-Rewrite // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice) // Append the query string if it exists and isn't null require("index.php"); ?> |
|
然后在web.config中新增一条规则,并将此规则置于规则集合的顶部:
| 代码如下 | 复制代码 |
|
|
|
效果如下
如果 WordPress 不是装在根目录,则需要更改“”为“”。如果在固定链接设置里把默认的标签前缀和分类目录前缀(tag 和 category)改了,则更改这句里的对应内容即可。
deepin20怎么新增字体? deepin20安装字体的教程
Linux如何给文件权限? linux给文件添加可执行权限的技巧
deepin20桌面图标样式怎么修改? deepin更换图标主题的技巧
virtualbox打不开虚拟机怎么办? linux无法访问virtualbox的解决办法
deepin怎么注销系统? deepin系统注销与切换用户的方法
Manjaro linux怎么调鼠标速度? Manjaro鼠标设置光标速度的技巧