Codeigniter应用程序Apache到IIS

问题描述 投票:0回答:1

我有一个在Linux环境中运行的codeigniter应用程序,希望将其迁移到Windows环境。

我通过FTP迁移了文件。主页可以正确处理图像和样式,但是链接没有错误404。

是否与htaccess和web.config有关?我应该发布什么代码来帮助我?

php codeigniter iis web-config plesk
1个回答
0
投票

通过重写web.config的htaccess并更改base_url来解决。

<system.webServer>
    <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>

© www.soinside.com 2019 - 2024. All rights reserved.