WordPress will always replace anything between # BEGIN WordPress and # END WordPress with its core rules.
Place any additional rules either before # BEGIN WordPress or after # END WordPress .
In your case, since you’re adding rules to enable compression, I recommend placing those before # BEGIN WordPress .
I am doing this:
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
# BEGIN WordPress
<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
but it always delete everything at the top and just show, also it seems that the .htaccess files go back to permission 444 not 644 or 777 when I change it
# BEGIN WordPress
<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
Hm, that shouldn’t be a problem.
How are you editing the .htaccess file exactly, and how quickly does it revert?
Manually like ive done all my other project in dreamweaver and uploading it, it reverts right away, not sure if is the hosting or wordpress
Try accessing your server via FTP or SFTP and editing the file directly on the server with a plain text editor.
I tried deactivating all plugin, reupload .htaccess, follow your recommendations, it still doing the same, it only happen on this server, not sure if this could be apache server or wordpress because wordpress does not do it for all other site we have but hosted at http://www.site5.com this particular site is hosted somewhere else, so i think it can be the server?
What plugins do you have installed?