SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php naming convention

    hi,

    my site is hosted on an Apache 1.3.6 server. i am redoing my site with php and my question is about naming conventions. i know that when i've created files with ASP, i use the name 'default.asp' for the default file to load for a directory when a file name is not given ( ex. http://www.aspsite.com/). i believe the same is true for index.html on unix servers but i could be wrong because i don't know a lot about servers.

    is there such a name for php files? the reason i ask is that i tried the filenames index.php & default.php for the index page for my website and when i type the url into the browser (ex. http://www.mysitename.com/), the server gives an error message saying that authorization is needed to view the file. my temporary solution was to create a file named index.html which redirects the user to my index.php file but I suspect there is a better way. does something need to be done on the server?

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the default file is determined by the Webhost. but if you tried index.php and default.php and it didn't work, they obviously don't have it set up for that. if you can use your own .htaccess file on your host just throw this in there.

    DirectoryIndex index.php

    or if you want it to look for index.html if there's no index.php, use this.

    DirectoryIndex index.php index.html

  3. #3
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, i'll give that a try!

  4. #4
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DR_LaRRY_PEpPeR,

    hey, just wanted to let you know that my index page is now working. after much confusion my host realized that the index.php file needed to have a different extension. when i renamed it index.phtml, it worked fine. i'm not sure why they have their server set up this way, but it works. all of my other php files end with the .php extension

    thanks for the help.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This may help :

    http://www.phpbuilder.com/tips/item.php?id=79

    They really should add .php to their addtype for PHP, no reason not to. If they allow .htaccess, the above should help your .php files work (parse php). But, I suggest you inform them that .php is standard.

  6. #6
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the link. i had never seen this site before but it looks like a great reference and has been added to my favorites.


Bookmarks

Posting Permissions

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