0

Есть сайт, который время от времени перестает отвечать на запросы. Подозреваю что проблема кроется в роутинге т.к. в логах находится куча ошибок:
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.

Я плохо знаю apache, и поэтому прошу подсказать что в этом htaccess не так, я некого не прошу его переписывать, просто дайте совета.
Также есть подозрение что проблема может быть в неоптимизированных запросах к БД.

Options +FollowSymLinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files

Deny from 10.10.1.5

<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>

 # SEO URL Settings
 RewriteEngine On
 # If your opencart installation does not run on the main web folder make sure     you folder it does run in ie. / becomes /shop/ 

RewriteBase /

#Создание ссылок ЧПУ

###RewriteRule ^$1/$2/$3 /index.php?route=$1/$4&path=$2&product_id=$3 [L,QSA]
RewriteRule ^sitemap.html$ index.php?route=information/sitemap [L,QSA]
#RewriteRule ^catalog\.html /index.php?route=product/category [L,QSA]
#RewriteRule ^news\.html(.*) /index.php?route=information/news$1 [L,QSA]
#RewriteRule ^works\.html(.*) /index.php?route=information/works$1 [L,QSA]
#RewriteRule ^articles\.html(.*) /index.php?route=information/articles$1   [L,QSA]
#RewriteRule ^reviews/(.*)\.html /index.php?       route=information/reviews&rreview_id=$1 [L,QSA]
#RewriteRule ^reviews\.html(.*) /index.php?route=information/reviews$1 [L,QSA]
RewriteRule ^information/([^?]*) index.php?route=information/$1 [L,QSA]
RewriteRule ^product/([^?]*) index.php?route=product/$1 [L,QSA]
RewriteRule ^cache_([^?]*) cache.php?f=$1 [L,QSA]
#RewriteRule ^news/([^?]*) /index.php?route=information/news/$1 [L,QSA]

RewriteCond %{HTTP_HOST} ^www\.myserver\.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/robots.*
RewriteRule ^(.*)$ http://myserver.com/$1 [R=301,L]

##RewriteCond %{REQUEST_FILENAME} !-d
##RewriteCond %{REQUEST_URI} ^(.+)/$
##RewriteRule ^(.+)/$ /$1 [R=301,L]

RewriteRule /eksklyuzivnaya-vinnaya-kollekciya/    http://myserver,com/vino/eksklyuzivnaya-vinnaya-kollektsiya/ [R=301,L]
RewriteRule /Vieil_Armagnac_Sempe_1948_Sempyе_V_ei_Arman_jаk-v_podar_up/   http://myserver,com/krepkie-napitki/armanyak/vieil-armagnac-sempe-1948-sempe-vej-  armanyak-v-podarup/ [R=301,L]
#Redirect 301 /Dopff_au_Moulin_Dopf_o_Mulen/ http://myserver,com/dopff-au-moulindopf-o-mulen/


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP
RewriteRule ^index\.php$ http://myserver,com/ [R=301,L]

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L,QSA]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^yandexmarket.xml$ index.php?route=feed/yandex_market [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the   following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
php_value max_input_vars 10000

1 ответ 1

1

Т. к. в .htaccess выполняется перенаправление запросов с www на имя сайте без www, то нужно проверить настройки CMS, относящиеся к имени сайту, т. к. там, скорее всего, указано имя с www и CMS пытается выполнить обратное перенаправление.

3
  • Да, там одинаковое имя. Это может вызывать серьезные проблемы?
    – QWERTY
    11 июн 2016 в 9:19
  • @QWERTY, нет, само имя в .htaccess проблем вызывать не будет :) Но если оно отличается от имени сайта, заданного в настройках CMS - то, в зависимости от CMS,это может приводить к проблемам, в том числе и описанными вами. У вас же OpenCart? Вам нужно убедиться, что в файлах config.php и admin/config.php, в параметрах, относящихся к имени сайта ('HTTP_SERVER' и 'HTTPS_SERVER'), указано имя сайта без www, т. е., как и в файле .htaccess.
    – МАН69К
    11 июн 2016 в 10:22
  • К сожалению там все ok(
    – QWERTY
    11 июн 2016 в 10:35

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.