Index.html/php/etc problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Index.html/php/etc problem

Post 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
User avatar
Lord Sauron
Forum Commoner
Posts: 85
Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL

Localhost

Post by Lord Sauron »

Try typing 'localhost' instead of a url. This will help ;-)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

have you set

Code: Select all

DirectoryIndex
directive?
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

DirectoryIndex index.php index.html index.shtml #and so on...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
Post Reply