index.php - Question

Discussion in 'PHP' started by robert_sans, Feb 12, 2007.

  1. #1
    Hello,

    I do not know much about php or web development. I am creating a website based on PHP template and I want to have www.mysite.com/index.php to be the first page when i key in the site address.

    I believe, the first page that is loaded into the browser is index.html when i type in my site address, i renamed it so that the index.php would load first. but the browser is coming up Page Not Found.

    ANy help would be appreciated.

    Thanks
     
    robert_sans, Feb 12, 2007 IP
  2. nightmaster

    nightmaster Peon

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you are using Apache, you can use the .htaccess file. you should add there "rewriterule index.html index.php"
     
    nightmaster, Feb 12, 2007 IP
  3. robert_sans

    robert_sans Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks nightmaster. But what other alternatives are there if it is not apache
     
    robert_sans, Feb 12, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    Or DirectoryIndex index.php if you're gonna use .htaccess.
     
    nico_swd, Feb 12, 2007 IP
  5. SoftCloud

    SoftCloud Well-Known Member

    Messages:
    1,060
    Likes Received:
    28
    Best Answers:
    2
    Trophy Points:
    120
    #5
    It sounds to me like you dont have PHP enabled where you're hosted.
     
    SoftCloud, Feb 12, 2007 IP
  6. robert_sans

    robert_sans Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Softcloud, when i provide, www.mysite.com/index.php it works fine. my hosting provider is for php solutions
     
    robert_sans, Feb 12, 2007 IP
  7. SoftCloud

    SoftCloud Well-Known Member

    Messages:
    1,060
    Likes Received:
    28
    Best Answers:
    2
    Trophy Points:
    120
    #7
    Ahhh, hmmm... that is strange then. :/

    Couldn't you use a META Redirect from index.html to index.php ?
     
    SoftCloud, Feb 12, 2007 IP
  8. joesgraphics

    joesgraphics Peon

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    have u tried deleting the index.html
     
    joesgraphics, Feb 12, 2007 IP
  9. ketan9

    ketan9 Active Member

    Messages:
    548
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #9
    What if you type in manually http://www.site.com/index.php? Do you see the PHP Code or the correct HTML output? This would let you know if PHP is enabled or not. Moreover, you should let us know what is your server config so that we know what to suggest to you.
     
    ketan9, Feb 13, 2007 IP
  10. Icheb

    Icheb Peon

    Messages:
    1,092
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It is possible that index.php isn't in the DirectoryIndex list, as nico_swd suggested. I've seen it a few times that there's only index.php3 and .php4. Try adding that.
     
    Icheb, Feb 13, 2007 IP