Page 1 of 1

Index.html/php/etc problem

Posted: Wed May 19, 2004 2:29 pm
by mjseaden
Dear All

I've set up my Apache server to pass any file without an extension as a PHP script. This is great, but when I just type the plain domain name without any /file.php into my browser, it says " you are forbidden to access '/' ", rather than automatically directing to 'index' on the root of the server.

How can I make the server direct to 'index' on just typing the domain name?

Many thanks

Mark

Localhost

Posted: Wed May 19, 2004 2:33 pm
by Lord Sauron
Try typing 'localhost' instead of a url. This will help ;-)

Posted: Wed May 19, 2004 2:33 pm
by feyd
have you set

Code: Select all

DirectoryIndex
directive?

Posted: Wed May 19, 2004 2:34 pm
by mjseaden
Hi Feyd,

No, and I don't know the syntax - what's the command? I only really know at the moment how to use the 'Files' directive.

Many thanks

Mark

Posted: Wed May 19, 2004 2:39 pm
by feyd

Code: Select all

DirectoryIndex index.php index.html index.shtml #and so on...

Posted: Wed May 19, 2004 2:55 pm
by Weirdan
for your case it would be:

Code: Select all

DirectoryIndex index # you can add another dir-indices as well
I'd recommend you instead of setting your Apache to parse files without extension as php use MultiViews directive. This way you can have your php files named filename.php but still access it without the extension in url.