My .htaccess file?

I got a “your site has been flagged for malware” notice from godaddy pointing to my .htaccess. file, I opened it up and nopticed this

RewriteRule ^([^/]*)/$ inspire-far.php?$1 [L]

thats the pphp file that its pointing to, do you know what the code in my .htaccess file means and whats the harm in deleting that line?

Have you tried examining the file contents?

If the file was not created by yourself then I would panic and immediately start by changing all passwords.

1 Like

I faced the same issue 1 year ago. This is what I did.

Open your .htaccess file and copy the code on Microsoft word. Now delete the .htaccess file and make a new .htaccess file and paste the code into it.

This will surely help you out.

Probably better to use a plain text or code editor to work on htaccess.

Would that not just create an identical htaccess file, with exactly the same suspicious redirect?

Yes, do make a back-up of your htaccess before modifying it, certainly if you are not confident in htaccess, so you will have that if you get it wrong.

Sam, we should not create multiple .htaccess file on the server at a given point of time.
So it’s recommended to first delete and then create a new file.

No. Do not delete the working file. Rename it or temporarily move it to another folder.

2 Likes

That was not my point. I was saying it is advisable to create a back-up copy of the htaccess before editing it, as a fall back in case you break anything in there. That back up does not necessarily have to be on the server, it could be a local copy, or re-named on the server.

It is actually quite OK to have multiple htaccess on the server, in different directories, as different directories may have different access permissions. For example some people keep include files above the root in a protected folder.

I prefer to edit and test locally, not on the server. Then only when it works as expected, upload to the server, overwriting the old version. If you delete, there will be a period where the file is missing.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.