Expires Headers broke my site

#422130
  • Resolved Pen Hack
    Rank Math free

    Website: https://mathtutorlausanne.ch

    At this link:
    https://rankmath.com/blog/add-expires-headers-wordpress/
    I followed your instructions to the letter, specifically method 2.2 Add Expires Headers On An Apache Server. (This is by no means my first time editing an htaccess file.)

    When I refreshed my site, I got a Server Error! and “Contact the webmaster”. –

    which is useless because I AM the webmaster, and the overall configuration techie etc. for this site. So I had to put back the old htaccess backup I had made immediately.

    But what gives? Your instructions are still online, in spite of this appalling effect on my website!

    I do not wish to install a plugin for this, so can you please explain?

    SwissP

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    The sample provided from our guide has syntax errors (extra quotes) and the use of smart quotes (only usable on Windows).

    Please try using this code instead:

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html "access 1 month"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/javascript "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType image/svg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/xhtml+xml "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 4 days"
    </IfModule>

    Please take a backup first of your current .htaccess file before making any changes. You can also get in touch with your web host for assistance.

    Also, I have raised the incorrect code in our guide to our development team to update it as well.

    I hope that helps.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Expires Headers broke my site’ is closed to new replies.