Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
header("Location:") function doesn't work on live server

I've developed my website on localhost, and I upload all the files on the server now. Unfortunately, when I go to the account page while I'm not connected, the redirection using the header('Location: /login') function isn't working. I've tried many solutions, like using the function ob_start() and ob_end_flush(), but it still doesn't work. I've also tried to change the paths, without any good results.

account.php

logged_only();
require 'includes/needed.php';

// ...

logged_only() function

function logged_only()
{
    if (!isset($_SESSION['auth'])) {
        header('Location: /login');
        exit();
    }
}

Hope you can help me

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda