500 Внутренняя ошибка сервера — запрос превысил лимит в 10 внутренних перенаправлений

#php #apache2

#php #apache2

Вопрос:

я настроил свой сервер и попытался получить доступ к сайту и получил ошибку внутреннего сервера 500.

Ich проверил мои журналы и обнаружил следующие ошибки. Я понятия не имею, почему я получаю ошибку. Я работаю с CodeIgniter.

Это журналы ошибок:

 [Thu Oct 01 19:24:45.722508 2020] [authz_core:debug] [pid 21444] mod_authz_core.c(809): [client 31.17.253.157:34572] AH01626: authorization result of Require all granted: granted, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.722568 2020] [authz_core:debug] [pid 21444] mod_authz_core.c(809): [client 31.17.253.157:34572] AH01626: authorization result of <RequireAny>: granted, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723514 2020] [core:error] [pid 21444] [client 31.17.253.157:34572] AH00124: 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., referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723537 2020] [core:debug] [pid 21444] core.c(3833): [client 31.17.253.157:34572] AH00121: r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723542 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723546 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723642 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723653 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723658 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723664 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723669 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723674 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723680 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /paulshop/index.php, referer: http://sneakerstore.tk/en/home
[Thu Oct 01 19:24:45.723685 2020] [core:debug] [pid 21444] core.c(3840): [client 31.17.253.157:34572] AH00122: redirected from r->uri = /favicon.ico, referer: http://sneakerstore.tk/en/home
  

И это мой файл .htaccess:

 <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /paulshop/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /paulshop/index.php [L]
</IfModule>
  

И это конфигурация веб-сайта:

     DocumentRoot /var/www/paulshop

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    LogLevel debug

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
<Directory /var/www/paulshop>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
</Directory>
  

Этот класс вызывает URL:

 <?php

class Web_welcome extends CI_Controller{

    function index()
    {
        $property = $this->Property->get();
        list($lang, $country) = explode('_', $property[0]->lang);
        
        header('location:'.base_url().$lang.'/home');
        exit;
    }

}
  

Это базовый URL:

 $config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'],'', dirname($_SERVER['SCRIPT_FILENAME']));
  

Может быть, кто-нибудь знает, как мне помочь.
Спасибо

Комментарии:

1. Похоже, ваш код вызывает бесконечный цикл перенаправления. Id начните с проверки маршрутизации для страницы, на которую вы пытаетесь перейти. Если есть механизм входа в систему, Id также просматривает любые связанные маршруты, контроллеры и промежуточное программное обеспечение, чтобы увидеть, есть ли где-нибудь неправильно настроенный условный оператор

2. Я отредактировал свой пост выше, может быть, вы знаете, как исправить?

3. Вы можете удалить RewriteBase /paulshop/ ?

4. К сожалению, не исправлено.