1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect Index Page Script

Discussion in 'General PHP and MySQL Discussions' started by BrandonT, Feb 25, 2012.

  1. BrandonT

    BrandonT Member

    Wasn't sure were exactly to post this but I want to set my forums up at mysite.com/community
    and need to know how to redirect mysite.com to the /community?

    Thanks for any help.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use this code in a .htaccess file in the web root:

    Code:
    Redirect 301 / /community/
    
    Or upload an index.php file with this code:

    Code:
    <?php
    
    header("Location: http://www.mysite.com/community/");
    
    ?>
    
    The index.php file would be more appropriate unless the forum previously resided in the web root and you need to redirect all of the old links.
     

Share This Page