.htaccess automatically update to old htaccess after 20 seconds

851 Views Asked by At

I have been trying from past 2days to add expiry header code at the end in .htaccess of my wordpress site to increase loading speed but after updating it from cpanel it shows me increased file size as 746bytes and last modified date as today. But after 20 or 30 seconds it automatically update file to default wordpress .htaccess and shows last modified date as 25th september,2015 and file size as 235 bytes. I don't understand why this is happening.

I checked for crons, but there is no cron setup for the site.

I tried deleting old .htaccess and upload my new .htaccess, but it modifies automatically and shows last modified date as 25th september,2015.

Here is my .htaccess code:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    <IfModule mod_expires.c>
    # Enable expirations
    ExpiresActive On 
    # Default directive
    ExpiresDefault "access plus 1 month"
    # My favicon
    ExpiresByType image/x-icon "access plus 1 year"
    # Images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    # CSS
    ExpiresByType text/css "access plus 1 month"
    # Javascript
    ExpiresByType application/javascript "access plus 1 year"
    </IfModule>

Can anyone suggest me how i can fix this.

0

There are 0 best solutions below