PHP Redirect location with htaccess

Posted by Wayne on Stack Overflow See other posts from Stack Overflow or by Wayne
Published on 2010-03-28T19:58:05Z Indexed on 2010/03/28 20:03 UTC
Read the original article Hit count: 175

Filed under:
|
|
|
|

In one of the page I have is where administrators are allowed, however, I use if the session isn't set, the header will redirect them to index.php and that method works.

If I replace index.php with home which is for the htaccess which changes it to index.php but it gives an error in the browser

This works:

if(!isset($_SESSION['MEMBER'])){ header("Location: index.php"); }

This does not work:

if(!isset($_SESSION['MEMBER'])){ header("Location: home"); }

htaccess:

RewriteRule ^home$ index.php

The error in Firefox:

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

What's wrong with it? How do I get this method to work?

© Stack Overflow or respective owner

Related posts about php

Related posts about .htaccess