PHP file as index/home, other than index.php

Discussion in 'HTML & Website Design' started by pjk, Jan 27, 2008.

  1. #1
    Hello,
    I am creating a homepage, and I want it to be a PHP file (ex. domain/index.php - basically something that will automatically go to domain.com). However, when I have the homepage as index.php, the "Top Files", "Latest Files", etc. pages (which are .php) don't work as they are the links such as http://domain.com/index.php?cmd=all . How can I find a way around this problem so that I can have latest files pages, etc., but still have a homepage index.php file exist?

    Thanks in advance.
     
    pjk, Jan 27, 2008 IP
  2. ilovelinux

    ilovelinux Peon

    Messages:
    285
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Post your .htaccess file pls.
     
    ilovelinux, Jan 27, 2008 IP
  3. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #3
    This directory does not have a .htaccess. Does this mean it takes from the root .htaccess? Thanks
     
    pjk, Jan 27, 2008 IP
  4. ilovelinux

    ilovelinux Peon

    Messages:
    285
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try creating a .htaccess file.
     
    ilovelinux, Jan 27, 2008 IP
  5. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Okay, I have created one. It is blank.
     
    pjk, Jan 28, 2008 IP
  6. ilovelinux

    ilovelinux Peon

    Messages:
    285
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    What have you placed inside the .htaccess file? Can you place it here.
     
    ilovelinux, Jan 28, 2008 IP
  7. newcentury

    newcentury Well-Known Member

    Messages:
    193
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #7
    Yes, with a correct .htaccess file, your problem will be solved. If you don't know what it is used for, I recommend you read this article on wiki:
    http://en.wikipedia.org/wiki/Rewrite_engine
    Code (markup):
     
    newcentury, Jan 28, 2008 IP
  8. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #8
    I haven't placed anything inside of the .htaccess file. What do I need to place in it? It is blank right now.
     
    pjk, Jan 28, 2008 IP
  9. gpearce

    gpearce Active Member

    Messages:
    1,432
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    90
    #9
    What was the file that was previously index.php, rahter than the homepage? There's an option you can place in the .htaccess which will change the default page, so put it back as it was, and Google "changing default apache file" ; there should be something there. That's your best bet, I think.
     
    gpearce, Jan 28, 2008 IP
  10. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #10
    index.php was a core.tpl.php & categories.tpl.php files combined. I just put index.php back to what it was normally. What do I add to the .htaccess file to change this? Thanks in advance.
     
    pjk, Jan 29, 2008 IP
  11. gpearce

    gpearce Active Member

    Messages:
    1,432
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    90
    #11
    So which page do you need to launch first?
     
    gpearce, Jan 29, 2008 IP
  12. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #12
    What do you mean? I need a .php file as my homepage. So when I go to domain.com, it goes to the .php file. Anything but index.
     
    pjk, Jan 29, 2008 IP
  13. JakeCohen

    JakeCohen Peon

    Messages:
    358
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Maybe try a redirect? Please explain what you mean...

    What a redirect will do is suddenly redirect you from your homepage to a different page.
    For instance from domain.com to domain.com/life.php
    or if you put a index.php inside of a folder called life domain.com/life/
     
    JakeCohen, Jan 29, 2008 IP
  14. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #14
    A redirect would work, possibly. Here is the situation. I have domain.com. There is a file which contains some stuff for a download system called "index.php". I don't need it. However, it seems other links that feed from that index file need it... such as http://domain.com/index.php?cmd=all . Without index.php correct, those types of links won't work. So basically what I need is a php page that will be shown when a user goes to domain.com . I know index.php is what is the default. When you go to domain.com right now, it goes to index.php. I want to change this so when you go to domain.com, it pulls up a php files, but it can't be index since that one is "used". Thanks
     
    pjk, Jan 29, 2008 IP
  15. pjk

    pjk Well-Known Member

    Messages:
    624
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #15
    Hell,
    Does anyone know how I can do this? Simply make a redirect? Thanks. I greatly appreciate your help.
     
    pjk, Feb 1, 2008 IP