SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirecting to page in another directory

    Hi,

    I want to redirect to a page in another directory, How can I do it in PHP?

    Exaple, I want to jump from htdocs/site/test1/index.php to htdocs/site/test2/index.php.

    Thanks

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    you're trying to make the browser reload into the new directory (via header)? or including the content of the new directory in the current page (via include)? Or are you trying to do it with .htaccess in apache (which would be a different forum)?
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Referring to you question I think I should use header syntax. I want browser to reload into the new directory.

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Below worked for me
    header('Location:/site/test2/');


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •