why wont this 301 redirect work?

Discussion in 'HTML & Website Design' started by Vic_mackey, Nov 17, 2007.

  1. #1
    Okay, I wanted to permanently redirect a page back to my home page.

    So I've opened up the file (.php), and deleted all the content out of it, and replaced it with:

    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://www.xxxxx.com/index.php");
    exit();



    I wanted to do it this way rather than changing htaccess. It never worked. Does anyone know why?

    thanks
     
    Vic_mackey, Nov 17, 2007 IP
  2. Vic_mackey

    Vic_mackey Banned

    Messages:
    2,093
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Okay I've done it now with htaccess, but out of curiousity does anyone know why the method above didnt work, have I been told a wrong way to do it?
     
    Vic_mackey, Nov 17, 2007 IP