【发布时间】:2015-10-23 22:02:16
【问题描述】:
这快把我逼疯了!我确实花了 5 个小时来解决我提到的here 的问题。将永久链接结构设置为自定义
mysite.com/%postname%/
主页mysite.com 有效,但子页面均无效。我尝试使用https://wordpress.org/support/topic/removing-indexphp-in-permalinks-using-iis-8 的帖子 3 上显示的内容创建一个 web.config,但仅在根目录下存在 web.config 就会导致 500 Internal server errors 一切。我在那里放了一个 empty web.config,这也会导致每个页面上出现错误 500。顺便说一下,我有 Windows Server 2012 和 IIS8。
回顾一下:
- 没有
web.config,我可以像mysite.com一样访问主页,但我会在mysite.com/mysubpage等任何子页面上获得404。但是,这些子页面确实会显示mysite.com/index.php/mysubpage。 - 添加一个空的
web.config或带有https://wordpress.org/support/topic/removing-indexphp-in-permalinks-using-iis-8 上显示的内容的一个,我也尝试过http://codex.wordpress.org/Using_Permalinks#Using_Permalinks_Without_mod_rewrite 上的那个,但没有成功。每页500。 - 根据http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress,我不能在IIS8中使用mod_rewrite。
我要死在这里:(
【问题讨论】:
-
您确定您正在运行 Windows Web 服务器吗?
-
@DarylGill 我发现了问题所在。我需要在 IIS 中安装 URL Rewrite 2。 iis.net/downloads/microsoft/url-rewrite
-
@SpaghettiCoder 将其作为答案发布并接受。
标签: php mysql wordpress iis iis-8