Reputation: 1093
I get my web site appears only by typing the following: www.example.com/index.php
when typing: www.example.com nothing happens.
How to call index.php
on startup by typing my website's address.
Upvotes: 0
Views: 2936
Reputation: 8767
While you have not provided any technical details on your web server, I would suggest looking into DirectoryIndex.
The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name. Local-url is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.
Example:
DirectoryIndex index.html index.php
A request for http://mysite.com/docs/ would return http://mysite.com/docs/index.php if it exists, or would list the directory if it did not.
Upvotes: 1
Reputation: 46846
In the server
section of your nginx.conf (or whatever file it includes), make sure you have the line:
index index.php;
You ARE running nginx, aren't you? ;-)
Upvotes: 1
Reputation:
Create a .htaccess file and put it in your server root. Add the following to the file:
DirectoryIndex index.php index.html index.htm
Upvotes: 3