Web Hosting Talk







View Full Version : Index.php


TheBizDev
05-03-2007, 10:55 PM
I was wondering if older browsers ca see index.php :confused:
My overall concern is that since I have a forum, many visitors may not see it because their browsers do not recognize php? :eek: I may be wrong!

HunterHosting
05-04-2007, 03:39 AM
Thats done by the web server not the browser.

Jatinder
05-04-2007, 04:29 AM
Like HunterHosting said, the default page is determined and served by the server and not by the browser.

And don't worry about "browsers do not recognize php". PHP is processed on the server. The browser receives the HTML code only.

TheBizDev
05-04-2007, 10:33 AM
hmm... I am going to have to disagree. I was taking a class and there was discussion on how the browser chooses what default file to view, like .html vs.htm and even php. The overalll conclusion was that the browser will choose its default file to view if all three exist, and therefore the browsers is set up to do that by default.

unless of course you just have a php file.

bluedreamer
05-04-2007, 10:40 AM
hmm... I am going to have to disagree. I was taking a class and there was discussion on how the browser chooses what default file to view, like .html vs.htm and even php. The overalll conclusion was that the browser will choose its default file to view if all three exist, and therefore the browsers is set up to do that by default.

unless of course you just have a php file.

The browswer doesn't choose at all, it only displays what the web server sends to it. On a typical web server there is a prioritised order of "index" page names, ie

index.htm
index.html
index.shtml
index.php
index.php3

When a page is requested at http://mydomain.com the server will first look for index.htm, if that doesn't exist it then looks for index.html and continues until it finds a match. Whichever file is found first it processes and sends to the users web browser, and then displayed in the browser window.

fastnoc
05-04-2007, 10:54 AM
Yup, without question bluedreamer is correct.

it's all based on whatever your server sets. You could have your server display .ttt files as html and have it use file.ttt as the default document and when you hit the site you'd get file.ttt read as HTML.

The browser accepts the information from the server. It plays no part in determining what document is found first.

If you look at your apache configs you'll see where it's established. If you're in IIS, right click a site and go to properties, then documents. That's where you set the associations and order.

Jatinder
05-04-2007, 11:00 AM
hmm... I am going to have to disagree. I was taking a class and there was discussion on how the browser chooses what default file to view, like .html vs.htm and even php. The overalll conclusion was that the browser will choose its default file to view if all three exist, and therefore the browsers is set up to do that by default.


Well. the only thing I can say is that you have been taking the wrong classes. When you open the URL http://google.com in your browser, the browser opens a socket on port 80 to google.com and then sends the following HTTP request to the server.

GET / HTTP/1.1

The server looks for index file for the "/" directory. For Apache, the DirectoryIndex (http://httpd.apache.org/docs/1.3/mod/mod_dir.html#directoryindex) directive determines which file to serve.

TheBizDev
05-04-2007, 11:39 AM
That's what I mean, althought I didn't say they exact same way. :D
Don't get me wrong I am now questioning anybody's ability or knowledge, I am questioning my own. :)

The browswer doesn't choose at all, it only displays what the web server sends to it. On a typical web server there is a prioritised order of "index" page names, ie

index.htm
index.html
index.shtml
index.php
index.php3

When a page is requested at http://mydomain.com the server will first look for index.htm, if that doesn't exist it then looks for index.html and continues until it finds a match. Whichever file is found first it processes and sends to the users web browser, and then displayed in the browser window.

siforek
05-04-2007, 03:49 PM
I question why in every class I've ever taken, the teacher/professor knew 10 times less than I did? How do they get hired?

CoreBlue-Mike
05-04-2007, 03:53 PM
I question why in every class I've ever taken, the teacher/professor knew 10 times less than I did? How do they get hired?

Ugh, don't get me started. That and a combination of you can't understand them AND you're actually paying for it.