Receiving 403 Forbidden - No Permission Error Message with INDEX.SHTML

If you create websites using Server Side Includes (SSI), you may run into this problem some day. Scenario: You've tested for weeks on your local server and now you're ready to upload the website files to the server.

You're using the same robots.txt file template and .htaccess file template you use for other websites, and you know they have no errors.

So the moment has come. After uploading the files, you carefully type in the website URL and ... you receive a "You don't have permission to access / on this server" error message and a large error code 403 with the word "Forbidden" shouting at you. Aargh!

After much anguish, I figured it out. So if you can't get your index.shtml homepage to load either, here is the answer:

Place the following line of code as the FIRST line in the .htaccess file:


DirectoryIndex index.shtml

This tells the server that not only does index.htm and index.html work as the default home page, but that the server should also recognize index.shtml - an indication of the use of server side includes - as well.

I'd never had to use this line of code before after all these years, but now it is the first line of code in all of my .htaccess files!

Thanks for stopping by. Cheers!

2 comments:

  1. Thank you for this excellent post. I've spent most of the day trying this and that, thank goodness I finally found this post. Even my Web Host couldn't tell me! Thanks!

    ReplyDelete
  2. I also looked and looked and finally found your nice article. Why don't website hosting companies put this information in their tutorials? Anyway, Thank you!

    ReplyDelete