在Windows Azure中从Codeigniter中的URL删除index.php

Ron*_*tel 2 php codeigniter url-rewriting azure

我正在尝试在Windows Azure平台上开发网站。我想从codeigniter项目的URL中删除index.php。

我在这里找到1个解决方案:

但是,我不知道azure管理面板中的web.config文件在哪里?

谁能告诉我确切的位置?我可以从他们的网站更改该文件吗?

谢谢。

小智 5

此web.config应该与codeigniter一起使用。

只需创建一个名为web.config的文件并将其上传到Azure上的wwwroot文件夹(index.php所在的文件夹)

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Rule" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                            <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

让我知道你是怎么办的!

谢谢