Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
index.html, PHP equivalent?
Old 05-26-2005, 06:12 AM index.html, PHP equivalent?
bez
bez's Avatar
Skilled Talker

Posts: 53
Trades: 0
everybody knows that if you put index.html in a directory the browser will show it, and not the directory view.

My homepage will be in PHP, when I put it as index.php browsers give a directory view, obviously not what i want. What do i put in the root directory to show as my homepage??? (i really dont want an index.html containing a javascript redir)

Do I need to write a PHP script to periodically create a static index.html file? I would rather not do something this complicated if it can be avoided

Thanks for any feedback
bez is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-26-2005, 06:15 AM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
use this index.htm don't put L at the end
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-26-2005, 06:28 AM
bez
bez's Avatar
Skilled Talker

Posts: 53
Trades: 0
but index.htm will not parse the php code, wont it?
bez is offline
Reply With Quote
View Public Profile
 
Old 05-26-2005, 06:49 AM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
Sounds like a configuration issue with your web server, it should use index.php if present. Check with your hosting people.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 05-26-2005, 07:08 AM An .htacess file could help
Average Talker

Posts: 15
Location: New Jersey
Trades: 0
create an .htaccess file if you dont have one already and put the following code;
to stop showing a directory:
Options -Indexes
To make index.php the main page:
DirectoryIndex index.php
if you make it like this...
DirectoryIndex index.php otherpage.php index.html it will search for the index.php first and if that doesnt exist then it looks for otherpage.php and finally index.html if both of the pages dont exist.

The .htaccess file will affect the folder it is in and all subfolders below it unless the subfolders contain thier own .htaccess file
wbarrett26 is offline
Reply With Quote
View Public Profile Visit wbarrett26's homepage!
 
Old 05-26-2005, 07:49 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
i'd say it the servers or php's fault ... what happends if (when you see the directory tree), you click the .php files? is php code interpreted or not?

if not talk to the hosting people about it ....
if it is interpreted ... also talk to the hosting people about it.

index.php should be displayed if present, if not it should go with index.htm ... but not the other way around.
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 05-26-2005, 08:00 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
If your hosting company proves to be reluctant then you can also parse .html files with the php interpreter with .htaccess as well. Just let me know if you need to go this route (unlikely).
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 05-26-2005, 08:09 AM
bez
bez's Avatar
Skilled Talker

Posts: 53
Trades: 0
Thanks for all the feedback guys. Ill think ill do some research into the .htaccess files, id like to have to have the control myself rather than talking to the host, whereever possible.
bez is offline
Reply With Quote
View Public Profile
 
Old 05-26-2005, 08:26 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
in this case i would rather talk to the host and find a good solution than look for a work-around...
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 05-26-2005, 01:59 PM
Average Talker

Posts: 15
Location: New Jersey
Trades: 0
the .htaccess stuff is pretty straight forward once you understand it. if you need any help let me know. The other advantage to .htaccess is its independance of the host. not matter what your host has default you can change the directory settings locally.

@cptnwinky
The only problem with parsing php within html file is that every html file will be parsed as php, increasing your page load times slightly. but if you dont expect a signifcant amount of traffic then it really doesnt matter.
wbarrett26 is offline
Reply With Quote
View Public Profile Visit wbarrett26's homepage!
 
Reply     « Reply to index.html, PHP equivalent?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30251 seconds with 12 queries