Azure webconfig上的Codeigniter

时间:2017-03-03 21:01:16

标签: php .htaccess codeigniter

我将基于CodeIgniter 2.x的旧网站部署到Azure网络应用程序。

我更改了基本网址,但是除了主网页之外,其他人都没有工作,它说它不存在。

我发现我们必须使用web.config而不是.htaccess。

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

这是我从旧网站.htaccess获取的代码,而不是我应该写入Azure的web.config中的内容?

1 个答案:

答案 0 :(得分:0)

您可能想尝试使用此web.config模板https://gist.github.com/wmandai/d28cc45f10a19eec0fcb