fbpx

How to fix ExpiresByType takes two arguments, a MIME type followed by an expiry date code

Quick Introduction

Recently I was optimizing a client website on a development server. Typically when optimizing I’ll start with going through .htaccess and ensuring that it’s set up for the best web performance. I will typically spend the most time with Expires headers. Every website will respond to expires headers differently which is the reason why it takes up most of my time during .htaccess optimization. Either way, I updated expires header on the website and boom, 500 Internal server error.

The Cause of the error

Apache reports an internal server for many reasons. Syntax within in .htaccess is included in this list. After verifying that your expires syntax is correct there’s one hidden syntax issue you may not have corrected. Many times when copying and pasting a piece code into .htaccess, you also copy hidden characters or blank spaces. Apache absolutely hates this. The blank spaces will typically be at the end of every line in the code you’ve added.

So what’s the fix?

The fix is simple.

Within the htaccess file, place your cursor at the beginning of the last line in the code added.

Press delete. What should happen is your line is now at the end of the line above. If it’s not, continue until it is.

Press Enter to place the line back into its original position.

 

I hope this helps!

 

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email

WE WANT TO HEAR FROM

you

Submit your e-mail for internet business tips and discounts

Get insight on the proper strategy for your project.