【发布时间】: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 中写下什么?
【问题讨论】:
-
您是否尝试过将重写规则移出
<IfModule mod_rewrite.c>? -
@Goose 哦,我没试过让我试试thx
-
移动重写规则有效吗?
标签: php .htaccess codeigniter