Results 1 to 6 of 6

Thread: Redirecting problem

  1. #1
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Redirecting problem

    I upload this php script to my subdomain "infscripts.freehostia.com":

    Code:
    <?php
    header( 'Location: http://Infantry.freehostia.com/InfHome.htm' ) ;
    exit;
    ?>
    to redirect to http://Infantry.freehostia.com/InfHome.htm . But whenever i go to infscripts.freehostia.com, all i see is the index/parent directory. Can anyone help me out?

    P.S. Yes im a total noob at php :P

  2. #2
    Join Date
    Nov 2006
    Location
    California, USA
    Posts
    336
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm that should work fine, be sure you named it index.php though(if you are trying to redirect from the subdomain.

  3. #3
    Join Date
    Feb 2006
    Location
    Franklin, Ohio, USA
    Posts
    991
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to name it index.php, not redirect.php

  4. #4
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oooo alright thanks

  5. #5
    Join Date
    Mar 2006
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    so is it working now?



    Dont Steal..

  6. #6
    Join Date
    Oct 2006
    Location
    I'm also from Michigan!
    Posts
    563
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    i know this is a php forum, and "header" will work fine for what your trying to do, but if youve written anything to the file before you use "header" it will give you an error and exit the script. so for redirecting i always use Javascript. It's alot more versatile for it. things like:
    Code:
    <script type=text/javascript>
    window.location.replace('whatever.html');
    </script>
    ^that will redirect the page and not let the user press the back button. Works great for $_POST vars so they wont press back and get the "This Page Has Expired" message.

    also it has Frames support, so you can redirect any frame from a different frame within the frameset....if that makes sense?

    just for future knowledge

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. New Problem
    By lilpaintballer in forum OSR Help
    Replies: 1
    Last Post: 09-24-2008, 12:48 AM
  2. ok i tried everything still have a problem...
    By Ipewnjoo in forum OSR Help
    Replies: 15
    Last Post: 01-29-2008, 04:23 PM
  3. Redirecting??? Help?
    By Timer in forum Web Development
    Replies: 20
    Last Post: 12-25-2007, 02:08 AM
  4. How do you stop redirecting?
    By kingarabian in forum Web Development
    Replies: 4
    Last Post: 11-21-2007, 06:12 AM

Posting Permissions

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