Page Redirecting Relative Path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • The KID
    New Member
    • Jan 2008
    • 4

    Page Redirecting Relative Path

    I'm trying to figure out how to do a page redirect to a relative path. This what I have:
    [PHP]header ("location: Home.php");[/PHP]
    but Home.php is one level up where the code is. I thought i could just type:
    [PHP]header ("location: ..\Home.php");[/PHP]
    but of course this didn't work. Any help?
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    Hi,
    I just tested this, and it worked fine...

    Code:
    <?php
    header ("location: ..\index.php");
    ?>
    Are you getting any errors, or what is happening?

    Comment

    • The KID
      New Member
      • Jan 2008
      • 4

      #3
      I just get a simply page not found

      The requested URL /~black/_scripts/..\Home.php was not found on this server.

      Never mind, Success! I played around with different slashes and it's working now. I swore i tried all the slashes earlier before and i was having the same problem but it seems to be working now. Thanks for your help anyways

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Since when do you use backslashes in urls?

        :P

        Comment

        Working...