By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,939 Members | 1,638 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,939 IT Pros & Developers. It's quick & easy.

How do I get index.php to be automatcially recognized by Apache?

P: n/a
I have install Apache and php5. I can execute php with no problem.
However, I would like index.php to be recognized and executed the way
that index.html is. That is, I want to be able to type
www.mysite.com in the browser and not have to always type
www.mysite.com/index.php.

Is that an .htaccess change of some sort? I not an Apache expert.

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Contact your host. It should recognize the index.php without having to type
it in. (It works for me!!!)

Shelly

<ku***@pobox.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have install Apache and php5. I can execute php with no problem.
However, I would like index.php to be recognized and executed the way
that index.html is. That is, I want to be able to type
www.mysite.com in the browser and not have to always type
www.mysite.com/index.php.

Is that an .htaccess change of some sort? I not an Apache expert.

Jul 17 '05 #2

P: n/a
Contact your host. It should recognize the index.php without having to
type
it in. (It works for me!!!)


I am the host, so to speak. I have installed php5, Apache and mysql locally
on my desktop machine.
Jul 17 '05 #3

P: n/a
On 04/07/2005 00:26, ku***@pobox.com wrote:
I have install Apache and php5. I can execute php with no problem.
However, I would like index.php to be recognized and executed the way
that index.html is.
You need to modify the configuration for the server. Find and open
httpd.conf in your favourite text editor and search for the
DirectoryIndex directive. It should look something like:

DirectoryIndex index.html index.html.var

You will need to modify that directive to include index.php. For example:

DirectoryIndex index.php index.html index.html.var

This means that if a request is made without a filename, the server will
first search for index.php, then index.html, and finally index.html.var.

[snip]
Is that an .htaccess change of some sort?


The DirectoryIndex directive can be set in a .htaccess file if really
necessary. However, if this is a local installation of Apache (for
testing, perhaps), then you may as well modify the server-wide settings.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 17 '05 #4

P: n/a
> You need to modify the configuration for the server. Find and open
httpd.conf in your favourite text editor and search for the DirectoryIndex
directive. It should look something like:

DirectoryIndex index.html index.html.var

You will need to modify that directive to include index.php. For example:

DirectoryIndex index.php index.html index.html.var

This means that if a request is made without a filename, the server will
first search for index.php, then index.html, and finally index.html.var.

[snip]


Thanks a lot! I made the change and it works now.
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.