BoundForGlory
BoundForGlory

Reputation: 4427

500 server error when adding .htaccess to website

My website is hosted on GoDaddy. I want to leverage browser caching, so I added an htaccess file.

When I do, my site returns 500 error. I deleted the htaccess file and my site returns to normal. What am I missing? Here is my htaccess file:

//Custom 404 errors
ErrorDocument 404 404.php

//Change default directory page
DirectoryIndex index.php

//Prevent viewing of .htaccess file
<Files .htaccess>
    order allow,deny
    deny from all
</Files>

//Prevent directory listings
Options All -Indexes

Thanks in advance

Upvotes: 2

Views: 101

Answers (1)

Meisam
Meisam

Reputation: 139

Is this the exact htaccess file?

  1. You have to display comments with # instead of //
  2. Change ErrorDocument 404 404.php to ErrorDocument 404 /404.php

Then if problem still exists, try this too:

  1. Change Options All -Indexes to IndexIgnore

Upvotes: 4

Related Questions