Página 1 de 1

[Resolvido] Ajuda com Err_Too_Many_Redirects

Enviado: 20 Ago 2018, 09:48
por otavioef
Olá, pessoal, bom dia.
Estou me deparando com esse ERR_TOO_MANY_REDIRECTS em minha loja. Não consigo sequer acessar o admin.
Não instalei ou alterei nada.

Procurei em diversos foruns e páginas diferentes mas nenhuma das soluções conseguiu me ajudar. A maioria trata como sendo problema no htaccess, mas eu não entendo muito, então não sei.

De qualquer forma aqui está o meu htaccess.
Código: Selecionar todos
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
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 /
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
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

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

RewriteCond %{HTTP_HOST} ^exemplo.com.br [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ http://www.exemplo.com.br/$1 [L,R=301]

<FilesMatch ^config.php$>
Deny from all
</FilesMatch>

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


# php -- BEGIN cPanel-generated handler, do not edit
# NOTE this account's php is controlled via FPM and the vhost, this is a place holder.
# Do not edit. This next line is to support the cPanel php wrapper (php_cli).
# AddType application/x-httpd-ea-php72 .php .phtml
# php -- END cPanel-generated handler, do not edit
Alguém tem alguma ideia do que pode ser?
Obrigado.

Usando OC 2.2.0.0

Re: Ajuda com Err_Too_Many_Redirects

Enviado: 20 Ago 2018, 12:23
por Manoel Vidal
Olá @otavioef.

Utilize o arquivo .htaccess padrão do OpenCart:
Código: Selecionar todos
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 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 ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
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

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

Re: Ajuda com Err_Too_Many_Redirects

Enviado: 20 Ago 2018, 14:47
por otavioef
OI, Manoel, tudo bem?
Obrigado pela resposta. Eu tentei aqui. Deletei todo o conteúdo e colei o que você me passou, mas nada mudou.
Ao acessar o site obtenho a url:

https://www.meudominio.com.br/install/i ... /index.php

e o erro de too many redirects.

Mais alguma ideia do que pode ser?

Obrigado


## EDITADO AQUI ##
Eu nunca setei o site como https, mas ele está buscando dessa forma.

Re: Ajuda com Err_Too_Many_Redirects

Enviado: 20 Ago 2018, 14:57
por Manoel Vidal
Ficou bem claro que você tem redirecionamento errado em sua hospedagem, no caso, verifique se esse redirecionamento está sendo feito pelo cPanel ou painel de sua hospedagem, e se ele não está sendo forçado por um certificado HTTPS.

Em último caso entre em contato com o suporte de sua hospedagem e solicite que lhe ajudem a resolver o problema, pois sem dúvidas é erro de redirecionamento.

Espero ter ajudado. :)

Re: Ajuda com Err_Too_Many_Redirects

Enviado: 20 Ago 2018, 15:57
por otavioef
Obrigado, Manoel. Já chequei e não está havendo nenhum redirecionamento no cpanel.
Pedi pra hospedagem verificar lá se há algo que possam fazer.
Vou aguardar. Obrigado pela ajuda.

Re: Ajuda com Err_Too_Many_Redirects

Enviado: 20 Ago 2018, 20:33
por Manoel Vidal
Atualize assim que tiver uma resposta da hospedagem. :)

Re: Ajuda com Err_Too_Many_Redirects

Enviado: 26 Ago 2018, 18:18
por otavioef
Fala, Manoel. Tudo bem? Sobre o problema descrito aqui, tive que restaurar um back up. Foi a única opção que restou. Tentei várias alterações no htaccess e no config, mas nada adiantou. A hospedagem disse que não alteraram nada lá... eu também não alterei nada aqui.... depois de 3 dias sem sucessos, restauramos um back up e voltou ao normal. De qualquer forma, obrigado pela força!