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
this should redirect any domainname, other than http://www.ourdomain.com, to be redirected to http://www.ourdomain.com
You should use the
ServerName
andServerAlias
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”.