【发布时间】:2020-09-29 13:52:10
【问题描述】:
我正在将一个站点从 linux 服务器迁移到 windows 服务器。该网站在 /blog 子文件夹中安装了 wordpress。 wordpress 网站的所有页面都给出了 404,除了主页。
我尝试将以下内容添加到域根目录中的 web.config 中:
<rewrite>
<rules>
<rule name="WordPress" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<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>
因为这适用于以前的 windows wordpress 安装,但那些以前的安装是在域的根目录中,而不是在子目录中。
请帮忙。
【问题讨论】:
-
这能回答你的问题吗? How to map or copy a wordpress site to a subfolder in an existing site's route?这个问题是针对子文件夹的,但对于子域来说,过程完全相同——这些答案中可能有一些帮助?
-
不,它没有帮助。 wp 站点始终位于 /blog 子文件夹中。唯一改变的是整个域正在从 linux 服务器转移到 windows 服务器。因此不再使用 htaccess,我必须使用 web.config。
标签: wordpress web-config http-status-code-404 windows-server