gpt4 book ai didi

iis - 可以替代Apache的IIS的.htaccess文件吗?

转载 作者:行者123 更新时间:2023-12-04 13:35:34 25 4
gpt4 key购买 nike

我正在将WordPress博客从Apache迁移到IIS。直到我把它换掉才过了几周。但是我只能进入主页。其他一切都会引发错误。

我认为我的问题出在.htaccess文件中:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#END WordPress

IIS是否有与此等效的东西?

谢谢。

最佳答案

我想您会在这里找到答案-How To Set Pretty Permalinks in Wordpress Runs On IIS 7我想您需要在根文件夹中放入一个web.config文件,例如:

<?xml version="1.0"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<remove value="index.php" />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<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>
</rules>
</rewrite>
</system.webServer>
</configuration>

关于iis - 可以替代Apache的IIS的.htaccess文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1778095/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com