Redirect URL - Header location strange problem

Discussion in 'PHP' started by minervait, Jun 18, 2010.

  1. #1
    Header location code is working fine in IE7, IE8, FF

    but in chrome while redirect the URL its removing page name and adding some random text.


    any help ?
     
    minervait, Jun 18, 2010 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    whats the code you are using?
     
    stephan2307, Jun 18, 2010 IP
  3. ttyler333

    ttyler333 Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #3
    stephan2307 is that really a needed question? He/she is posting in the php section.
     
    ttyler333, Jun 18, 2010 IP
  4. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #4
    Yes it is, without the code we can't help you.
     
    danx10, Jun 18, 2010 IP
  5. ttyler333

    ttyler333 Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #5
    haha I took it as what language its coded in... :p sorry, yeah i see your point..
     
    ttyler333, Jun 18, 2010 IP
  6. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Dude!
    Always have a ref in the Whole Thread!
    Without the PHP Snippet we can't solve mostly until he clearly describes it :)
     
    roopajyothi, Jun 20, 2010 IP
  7. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #7
    Try adding the following to the a line before your Header Location

    
    header("Status: 200");
    
    Code (markup):
    Example:
    
    header("Status: 200");
    header("Location: /page.php");
    
    Code (markup):
     
    MyVodaFone, Jun 20, 2010 IP
  8. clox.c

    clox.c Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    correct syntax for redirecting with header is something like
    header ("Location: htttp://example.com/page.php");

    also see php.net/manual/en/function.header.php
     
    clox.c, Jun 20, 2010 IP
  9. K1llswitch

    K1llswitch Member

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #9
    You want a HTTP Status 301 which means the page moved, otherwise Goog will index the page you're being redirected to as the page the redirection is on.
     
    K1llswitch, Jun 20, 2010 IP
  10. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #10
    As far as I know Chrome needs a status off 200
     
    MyVodaFone, Jun 20, 2010 IP