Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

251
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!