skip to Main Content

This morning I noticed that some results to our website have been poisoned in Google’s search results. Our domain seems to have been prefixed with a rather bad url. Quite hard to describe this, but about 25 results on our domain seem to be formatted like this:

www.pornographicwebsite.com_www.ourdomain.com/

http://pornographicwebsite.com_www.ourdomain.com/

I suspect I need to setup some more rigid htaccess rules because the ‘prefix’ can be changed to anything and the URL will still load:

www.afisudfhsiudfhiasufd.com_www.ourdomain.com/

http://dfsdjflkjsafasjf.com_www.ourdomain.com/

Google Analytics is saving these URLs and it’s really not appropriate considering the content of our website is aimed at children & parents

How can I block this sort of thing from happening please?

EDIT:
This is part of the config file as generated by plesk when the domain was added on our VPS:

<VirtualHost #.#.#.#:80>
   ServerName   ourdomain.com:80
   ServerAlias  www.ourdomain.com
   UseCanonicalName Off
   ServerAdmin  "[email protected]"
   DocumentRoot /var/www/vhosts/ourdomain.com/httpdocs

</VirtualHost>

How can I alter this to help?

2

Answers


  1. Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www.ourdomain.com$ [NC]
    RewriteRule ^(.*)$ http://www.ourdomain.com/$1 [L]
    

    this should redirect any domainname, other than http://www.ourdomain.com, to be redirected to http://www.ourdomain.com

    Login or Signup to reply.
  2. You should use the ServerName and ServerAlias directives in the main Apache configuration file to list exactly those names you expect the server to respond to.

    Any other name used will then result in a “404 error”.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search