Error 500: internal server error after set deny/allow in .htaccess file

Avatar
  • updated
  • Answered

I was following the WordPress article https://www.inmotionhosting.com/support/edu/website-design/access-specific-filetype/

In my .htaccess file under public_html folder, I pasted the exact code,

Order Allow,Deny
Deny from all

<FilesMatch ".(jpg|gif|png)$">
Order Deny,Allow
Allow from all
</FilesMatch>

Then I encountered Error 500 while trying to load up my website. Please advise. 

Pinned replies
Avatar
anonymous
  • Answer
  • Answered

Hello Jimmie, 

Thank you for your question regarding .htaccess code. I recommend adding a \ to the FilesMatch line as below:

<FilesMatch "\.(jpg|gif|png)$">

Best Regards, 

Alyssa K. 

Avatar
anonymous
  • Answer
  • Answered

Hello Jimmie, 

Thank you for your question regarding .htaccess code. I recommend adding a \ to the FilesMatch line as below:

<FilesMatch "\.(jpg|gif|png)$">

Best Regards, 

Alyssa K.