【发布时间】:2020-11-05 13:58:58
【问题描述】:
我没有使用 Windows Web 服务器的经验,所以我有点迷茫。我想设置一个将所有 url 路由到 index.php 的文件夹。我尝试了几种不同的配置,但其中任何一个都不起作用。
我将如何在 .htaccess 中做到这一点:
RewriteEngine on
RewriteBase /Software
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /folder/index.php?/$1 [NC,QSA,L]
我对 web.config 的尝试:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect To Index" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/folder/index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
【问题讨论】:
标签: windows iis web-config webserver web.config-transform