0

我正在将 codeigniter 应用程序部署到由 3rd 方 apache 服务器托管的子域上。访问页面时,它会不断刷新,然后浏览器告诉我发生了重定向循环。我知道这与我使用的 Apache conf 设置和自定义 .htaccess 文件有关,但我不知道如何修复它。

当前的 .htaccess 代码:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
4

1 回答 1

0

尝试另一个.htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

如果不是 - 尝试将最后一行更改为

RewriteRule ^(.*)$ /index.php/$1 [L]

还要确保您已$config['index_page']在 config.php 中设置为''

于 2012-08-24T21:56:55.213 回答