automatically forwarding mysite.com to mysite.com/forums

Discussion in 'HTML & Website Design' started by xyz, Aug 10, 2009.

  1. #1
    at mysite.com, I have and index.php file that I would like to keep as is if possible.

    index.php is a work in progress, and for now I'd like to have my visitors go directly to the forum if they type in www.mysite.com.

    However, I'd like to be able to go to www.mysite.com/index.php if I type that address in specifically.

    Does anyone know how I can do this? I'm with hostgator if that matters.
     
    xyz, Aug 10, 2009 IP
  2. headworker

    headworker Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It seems somewhat difficult to do because www.mysite.com and www.mysite.com/index.php will treated as same. So it will goes in infinite redirect loops. However if we do some research on it then we can fix it.
     
    headworker, Aug 10, 2009 IP
  3. xyz

    xyz Peon

    Messages:
    370
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    if there is an index.php and an index.html

    which one does it automatically go to?

    Maybe I can make an index.html that will forward the visitor...
     
    xyz, Aug 10, 2009 IP
  4. headworker

    headworker Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, you can create index.html which will get redirected.
     
    headworker, Aug 11, 2009 IP
  5. lufty

    lufty Active Member

    Messages:
    248
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Simply add this in .htaccess:
    DirectoryIndex filename.html

    This will make filename.html (or index.cgi index.pl default.htm. etc) be the default page when you load mysite.com
    So create a page filename.html, and add the above in your .htaccess, and whenever someone types mysite.com, it goes automatically to filename.html

    But if they type mysite.com/index.php, then it will go to the index.php file.
     
    lufty, Aug 11, 2009 IP