Categories
How-To Technical

Website redirecting to another site from search results

I was recently informed by a friend that jermsmit.com was redirecting to another site when clicked on a google search result link.

Initially, I thought he may have had some local malware. After a fair amount of time inspecting the web traffic, and review of site configuration, I was able to determine that the redirect was somehow originating from my site to a gambling site.

I determined that the redirect was originating from my htaccess file, which contained the following details:

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
RewriteCond %{HTTP_USER_AGENT} (google|yahoo|msn|aol|bing) [OR]
RewriteCond %{HTTP_REFERER} (google|yahoo|msn|aol|bing)
RewriteRule ^(.*)$ berate-inquisition.php?$1 [L]

I then performed the following steps:

  1. Backup the .htaccess file.
  2. Edit the current .htaccess file and remove the lines:
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
RewriteCond %{HTTP_USER_AGENT} (google|yahoo|msn|aol|bing) [OR]
RewriteCond %{HTTP_REFERER} (google|yahoo|msn|aol|bing)
RewriteRule ^(.*)$ berate-inquisition.php?$1 [L]

Once deleted, I located the file berate-inquisition.php and deleted that also.

Thank you Patrick for pointing this out to me. I am glad to report, that this is now resolved.

Leave a Reply

Your email address will not be published. Required fields are marked *