【问题标题】:Codeigniter on Azure webconfigAzure Web 配置上的 Codeigniter
【发布时间】:2017-07-24 02:57:29
【问题描述】:

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

我更改了基本网址,但是除了主网页,其他都不起作用,它说不存在。

我发现我们也必须有 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 中写下什么?

【问题讨论】:

  • 您是否尝试过将重写规则移出&lt;IfModule mod_rewrite.c&gt;
  • @Goose 哦,我没试过让我试试thx
  • 移动重写规则有效吗?

标签: php .htaccess codeigniter


【解决方案1】:

你可能想试试这个web.config模板https://gist.github.com/wmandai/d28cc45f10a19eec0fcb

【讨论】:

    猜你喜欢
    • 2021-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-02
    • 1970-01-01
    相关资源
    最近更新 更多