Jump to content

Proper Redirect


onlyican

Recommended Posts

I am building the part of my website which checks if a user has the right access level to be on that page

If there not, I will redirect them to a Log In Page

I will do this by

<?php
header("Location: ".root.".login.php";
?>

BUT
If I am redirecting someone, dont I need some more headers

Whats is the proper headers for redirecting someone to a diff page
Link to comment
Share on other sites

it states on the php.net site
[quote]
The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.
[/quote]

I dont want a 302 Redirect
So I need some 3xx Status Code??
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.