@bubble_25

Что является причиной цикла в htaccess?

Доброго времени суток, имеется сайт на DLE13, визуально все работает, но в логах ошибок "Request exceeded the limit of 10 internal redirects due to probable configuration error".
В файле .htaccess сайта правила mod_rewrite вызывают бесконечные перенаправления, что приводит к ошибке 500 Internal Server Error.

DirectoryIndex index.php

RewriteEngine On

RewriteBase /
RewriteRule ^(.*).(jpg|jpeg|png|svg|ico|js|css)$ $1.$2 [L]
RewriteRule ^blog/[0-9]+-(.*).html$ /$1 [R=301,L]
RewriteRule ^(.*).html$ /$1 [R=301,L]
RewriteRule ^(.*)/$ /$1 [R=301,L]

#############
RewriteCond %{REQUEST_URI} ^/service/service1|/serv$
RewriteCond %{QUERY_STRING} ^gclid=[0-9]*
RewriteRule ^(.*)$ /? [R=301,L]

RewriteCond %{REQUEST_URI} ^/blogs$
RewriteCond %{QUERY_STRING} ^format=feed&type=atom
RewriteRule ^(.*)$ /? [R=301,L]

RewriteCond %{REQUEST_URI} ^/blogs$
RewriteCond %{QUERY_STRING} ^format=feed&type=atom
RewriteRule ^(.*)$ /? [R=301,L]

RewriteCond %{REQUEST_URI} ^/blog/2-uncategorised$
RewriteCond %{QUERY_STRING} ^format=feed&type=rss
RewriteRule ^(.*)$ /? [R=301,L]

RewriteCond %{REQUEST_URI} ^/component/rsform/form/1-rsform-pro-example$
RewriteCond %{QUERY_STRING} ^tmpl=component
RewriteRule ^(.*)$ /? [R=301,L]
################

RewriteCond %{QUERY_STRING} ^format=feed&type=rss$
RewriteRule ^$ / [L,R=301]

RewriteRule ^page/([0-9]+)(/?)$ index.php?cstart=$1 [L]

RewriteCond %{REQUEST_URI} <
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*)$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*)$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*)$ index.php?mod=print&subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 [L]

RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*)$ index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.*)$ index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 [L]
RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*)$ index.php?mod=print&news_page=$2&newsid=$3&seourl=$4&seocat=$1 [L]
RewriteRule ^([^.]+)/([0-9]+)-(.*)$ index.php?newsid=$2&seourl=$3&seocat=$1 [L]

RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html$ index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 [L]
RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html$ index.php?newsid=$2&news_page=$1&seourl=$3 [L]
RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html$ index.php?mod=print&news_page=$1&newsid=$2&seourl=$3 [L]
RewriteRule ^([0-9]+)-(.*).html$ index.php?newsid=$1&seourl=$2 [L]

RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4 [L]

RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3 [L]

RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1 [L]
RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2 [L]

RewriteRule ^tags/([^/]*)(/?)+$ index.php?do=tags&tag=$1 [B,L]
RewriteRule ^tags/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=tags&tag=$1&cstart=$2 [B,L]

RewriteRule ^xfsearch/(.*)/page/([0-9]+)(/?)+$ index.php?do=xfsearch&xf=$1&cstart=$2 [B,L]
RewriteRule ^xfsearch/(.*)/?$ index.php?do=xfsearch&xf=$1 [B,L]

RewriteRule ^user/([^/]*)/rss.xml$ index.php?mod=rss&subaction=allnews&user=$1 [L]
RewriteRule ^user/([^/]*)(/?)+$ index.php?subaction=userinfo&user=$1 [L]
RewriteRule ^user/([^/]*)/page/([0-9]+)(/?)+$ index.php?subaction=userinfo&user=$1&cstart=$2 [L]
RewriteRule ^user/([^/]*)/news(/?)+$ index.php?subaction=allnews&user=$1 [L]
RewriteRule ^user/([^/]*)/news/page/([0-9]+)(/?)+$ index.php?subaction=allnews&user=$1&cstart=$2 [L]
RewriteRule ^user/([^/]*)/news/rss.xml(/?)+$ index.php?mod=rss&subaction=allnews&user=$1 [L]

RewriteRule ^lastnews(/?)+$ index.php?do=lastnews [L]
RewriteRule ^lastnews/page/([0-9]+)(/?)+$ index.php?do=lastnews&cstart=$1 [L]

RewriteRule ^catalog/([^/]*)/rss.xml$ index.php?mod=rss&catalog=$1 [L]
RewriteRule ^catalog/([^/]*)(/?)+$ index.php?catalog=$1 [L]
RewriteRule ^catalog/([^/]*)/page/([0-9]+)(/?)+$ index.php?catalog=$1&cstart=$2 [L]

RewriteRule ^newposts(/?)+$ index.php?subaction=newposts [L]
RewriteRule ^newposts/page/([0-9]+)(/?)+$ index.php?subaction=newposts&cstart=$1 [L]

RewriteRule ^favorites(/?)+$ index.php?do=favorites [L]
RewriteRule ^favorites/page/([0-9]+)(/?)+$ index.php?do=favorites&cstart=$1 [L]

RewriteRule ^rules.html$ index.php?do=rules [L]
RewriteRule ^statistics.html$ index.php?do=stats [L]
RewriteRule ^addnews.html$ index.php?do=addnews [L]
RewriteRule ^rss.xml$ index.php?mod=rss [L]
RewriteRule ^sitemap.xml$ uploads/sitemap.xml [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)/rss.xml$ index.php?mod=rss&do=cat&category=$1 [L]
RewriteRule ^page,([0-9]+),([^/]+).html$ index.php?do=static&page=$2&news_page=$1&seourl=$2 [L]
RewriteRule ^print:([^/]+).html$ index.php?mod=print&do=static&page=$1&seourl=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+).html$ index.php?do=static&page=$1&seourl=$1 [L]

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http:\/\/%1/$1 [R=301,QSA,L]

RewriteRule ^([^/.]+)$ /$1/ [L,R=301]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.(php|html?)$ / [R=301,L]


Что может создавать цикл?
  • Вопрос задан
  • 163 просмотра
Пригласить эксперта
Ответы на вопрос 1
shambler81
@shambler81 Куратор тега htaccess
Закидывай сюда и смотри
https://bertal.ru/index.php?a566754

А так же
RewriteRule ^(.*).(jpg|jpeg|png|svg|ico|js|css)$ $1.$2 замени на
RewriteRule ^(.+)\.(jpg|jpeg|png|svg|ico|js|css)$ $1.$2
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы