Backrgound shape | Mage H.D.
Home Blog Web Hosting How to fix ExpiresByType takes two arguments, a MIME type followed by an expiry date code

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

500 Internal Server Error | Mage H.D.

Table of Contents

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!

 

Related Articles

Graphical images showing the different aspects of web hosting | Mage H.D.

How to choose an ecommerce web host

Whether you’re launching a new on-premise online store on a platform like Magento or X-Cart or evaluating hosting options for an existing site, there are

Start your Free SEO audit

Let's locate your SEO issues.

| Mage H.D.