Problem with 302 redirect

Discussion in 'Site & Server Administration' started by Agent47, Jul 31, 2005.

  1. #1
    I am using a 302 redirect to one of my page as I don't want the page to be indexed by google. I am using the following code to redirect :
     
    $url = "http://www.mysite.com/test_page.php" ;
    header('location:' . $url .''); 
    
    PHP:
    Is the code above considered to be a 302 redirect as I just came to know that the page I am redirecting to i.e test_page.php is indexed by google. If it is not, can anyone give me an example of a 302 redirect ?

    Thanks
     
    Agent47, Jul 31, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    It is a 302, but a 302 does not prevent spidering.
     
    digitalpoint, Jul 31, 2005 IP
  3. Agent47

    Agent47 Well-Known Member

    Messages:
    775
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Is there anyway I can prevent this from spidering? and If I do so; will there be any penalty by google or something similar?

    Thanks,
     
    Agent47, Jul 31, 2005 IP
  4. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #4
    you could disallow * in your robots.txt
     
    Shoemoney, Jul 31, 2005 IP
  5. Agent47

    Agent47 Well-Known Member

    Messages:
    775
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    135
    #5
    My case is a little different. The variable $url actually gets value from the database and lets say there are 100 urls or 1000, its hard to disallow all of them in robots.txt
     
    Agent47, Jul 31, 2005 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    Disallow your redirection script.
     
    digitalpoint, Jul 31, 2005 IP
  7. Agent47

    Agent47 Well-Known Member

    Messages:
    775
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    135
    #7
    Thanks shawn and shoo :)
     
    Agent47, Jul 31, 2005 IP