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!

 

About Post Author

Related articles

easiest website builders top 2 for 2022
Sitebuilder
Hosterfi

Easiest website builders for 2022 – top 2

Are you looking for the easiest website builders recommended for beginners? Look no further we have done the market research to help you find the easiest website builders for your website. In America, we are almost halfway through 2022. It is absolutely

Read More »
how to do seo for your website step-by-step
Wordpress Tips and Tricks
Hosterfi

How to do seo for your website step-by-step

Handling your own SEO is a dire job. Until now, here’s how to do SEO for your website step-by-step with the right tools and keyword research. It is, in fact, a job on its own but there are easy tools out there

Read More »
The steps of using MarketGoo DIY SEO Software
Small Business
Hosterfi

DIY SEO Software for Small Businesses

The problem Why do you need a DIY SEO software for your small business? As a small business owner, there are a lot of expenses that come along with running your business. Since COVID 19, some businesses are on the brink of

Read More »

Sign up for our newsletter

Get the latest in discounts, news, and blog updates

Logo representing a veteran owned business
Talk.to partner logo