htaccess file keeps changing and causing wordpress site to crash?

ultramel1987

Well-Known Member
Joined
Dec 31, 2010
Messages
193
Reaction score
0
Hi

My htaccess file on my wordpress site (in the Cpanel), is supposed to look like this:
Code:
<Limit GET POST>
order deny,allow

# BEGIN WordPress

# END WordPress
</LIMIT>

however, it keeps changing itself to:

Code:
<Limit GET POST>
order deny,allow

# BEGIN WordPress

# END WordPress
>

and sometimes it even just has this:

Code:
# BEGIN WordPress

# END WordPress

I have not installed any new plugins which could be causing this, I have not even logged into the site, and it changes it, please can someone point me in the right direction to preventing this from happening, as each time that file changes, my site crashes.
thank you so much
 
You should take the issue up with your service provider. They could better investigate.
 
I've seen this happening with some plugins, especially W3 Total Cache.

Once you've corrected your .htaccess file, you can make it immutable:

chattr +i .htaccess

(ask your host to do this if you don't have shell access)

to make it impossible for this to happen again. You will need to run

chattr -i .htaccess

whenever you need to edit the .htaccess file (when enabling pretty permalinks, for example)
 
thank you for your reply. I have requested help from the host provider, however they say it is nothing on their side?
 
@Texo... thank you for your reply. I have suggested the ("chattr-i .htaccess) to the hosting company, however they feel it is not a good fix as the .htaccess file needs to update itself. They also say that they cannot pinpoint which Plugin is causing the problem?

Is there perhaps another method I could use to fix this or to find which plugin is causing the change in the file?

any advise would be greatly appreciated :-)

thank you so much
 
It's a very good fix until you can determine what's causing the problem. It is almost certainly one of your plugins, as the .htaccess file does not "update itself".

EDIT: could you post (or PM) me a list of the plugins you have activated?
 
thank you Texo. I will see if I can convince them to change it.
is there a way to see which plugin is doing this?
 
Well if you can edit the file then you should be able to change the file's permissions by right clicking it or using some tool in Cpanel itself

Make it read only, by checking the appropriate check boxes, (I would advise to remember the current permissions in case something goes wrong)
 
Make it read only, by checking the appropriate check boxes

Yup, this is a good solution too, and probably better than mine which is a sledgehammer when a normal hammer would work just as well ;)
 
I have never come across a provider that said that the .htaccess file NEEDS to update itself. That's a whole lot of bull**** right there

In my years admin'ing sites in Linux I've never come across this problem. It could be the host itself changing it "for" you.
 
Top
Sign up to the MyBroadband newsletter
X