0

index.php とアクセス コントローラー mysite.com/admin を削除しようとすると、内部サーバー エラーが発生し続けます。なぜうまくいかないのかわかりません。

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /code/

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

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

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

サイト構成

<Directory /home/mysite.com/public_html/>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory> 

Apache エラー ログ

[Sat Sep 08 15:24:30 2012] [error] [client 176.106.162.240] 
Request exceeded the limit of 10 internal redirects 
due to probable configuration error. Use 'LimitInternalRecursion' 
to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
4

3 に答える 3

0
You just need to create .htaccess file in project folder and write:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL 
RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 

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

 #And You don't need to define in base_url in config file:

 $config['base_url'] = '';// blank it.

 I hope it will work perfectly ...
于 2015-06-11T12:00:53.703 に答える
0

.htaccess を変更

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /code/

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

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

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

これに:

RewriteEngine On

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

他に何も必要ないと思います。

于 2012-09-08T13:31:26.153 に答える
0

詳細に見ないと問題があることがわかりますRewriteBase /code/

試してみてくださいRewriteBase /

于 2012-09-08T13:39:43.867 に答える