Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
Http to https error "ERR_TOO_MANY_REDIRECTS"

My problem is specific because site redirects are a bit complicated in the www folder with php codes

index.php

 <?
header("Location:https://www.example.org/kods_bird/uye/?fsx=@");
?>

this redirect exists and the kods bird folder has the same redirect

my .htaccess, Located in the www folder

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Why is ERR_TOO_MANY_REDIRECTS error?

Which solution am I looking for?

url request:http://www.example.org%{REQUEST_URI}
url redirect:https://www.example.org%{REQUEST_URI}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

So there was logical issue which caused looping inside rules.

So try this fix:

# rewrite non https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# if https but without www
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


let's analyze 1st situation:

http://www.example.org%{REQUEST_URI}

will be handled by first rule (https off) which will redirect to with https version:

https://www.example.org%{REQUEST_URI}


let's analyze 2nd situation:

http://example.org%{REQUEST_URI}

will be handled by first rule (https off) which will redirect to with https version:

https://example.org%{REQUEST_URI}

and after will be handled by second rule which will add www. as prefix:

https://www.example.org%{REQUEST_URI}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda