Forum Moderators: phranque

Message Too Old, No Replies

Can't run HTML files on apache

Can't run HTML files on apache

         

richiebman

6:08 pm on Aug 14, 2006 (gmt 0)

10+ Year Member



For some reason I can't figure out, my testing apache server (on my local machine) wont run HTML files and throws up a 403 Forbidden error reading:

'You don't have permission to access /index.html on this server.'

If I copy the file and call it index.htm, or index.php there's no problem and I don't get an error. However I want the site I'm working on to have .html file extensions and I can't start until this is sorted.

I'm sure it's the simplest thing that needs unchecking in the config file but server configuration isn't my area of expertise.

Cheers,
R

bcolflesh

6:15 pm on Aug 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the config file, check:

DirectoryIndex

index.html should be one of the entries, add it if it's missing.

richiebman

7:26 pm on Aug 14, 2006 (gmt 0)

10+ Year Member



That's already there:

DirectoryIndex index.htm index.html index.php

However, I just removed the following reference from my htacces file:

DirectoryIndex index.htm

and apache returned the directory (folder view). It didn't run the .htm file which it had been before. I know that really I shouldn't need to put a DirectoryIndex in the .htaccess file, but always had due to habit. So another problem is that DirectoryIndex doesn't seem to work in my config file.

encyclo

11:12 pm on Aug 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What operating system are you running on your local machine? If you open up a .html file locally (ie. not served via Apache) does the page display in the browser?

richiebman

6:55 pm on Aug 15, 2006 (gmt 0)

10+ Year Member



My OS is XP Pro and .html files open in Firefox perfectly fine if opened from my desktop.

I developed a site two years ago with files with the .html extension. I can't open that now (first time I've gone back to look at it in a long time). I have changed my harddrive and motherboard since then though and therefore reinstalled Apache. I may just have to do that again. Could a module by corrupted? It's just frustrating that everything else works apart from the default file type.

richiebman

8:40 am on Aug 20, 2006 (gmt 0)

10+ Year Member



Worked it out. I reset my config file with the default one and just added comments in and restarted the server until it failed. The problem was in:

<Directory "D:/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

The default is 'AllowOverride None' which worked. I've no idea why I had changed it to 'All' and I have no idea why this would have caused a problem. But it's fixed which is the most important thing ;)