Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Page redirect

  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page redirect

    I would like my domain to point to /index.php?id=news, rather than /index.php

    how can I do this?

  • #2
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is how I do it.

    Code:
    <?php
    include("headers.php");
    
    if (is_file("$page.php")) {
    include("$page.php");
    }
    
    else {
    include("news.php");
    }
    
    include("footers.php");
    ?>
    and i just link to things like this

    <a href="index.php?page=media">Media</a>

    http://www.spiderseatbabies.com/swee...php?page=media

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I think they are just trying to get index.php to redirect to a new page when its called. You could place this at the top of index.php
    PHP Code:
    <?php
    header 
    ("Location: http://www.yourdomainname.com/index.php?id=news");
    ?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New Coder
    Join Date
    Jan 2005
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    except the one you just gave me makes you have to change your cookie setting around..


  •  

    Posting Permissions

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