How to remove Plesk websites temporary urls from Google index?

How to remove Plesk websites temporary urls from Google index? - .htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, google-index, plesk, .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :


Google is indexing Plesk temporary URLs, I've tried the following tip but it does not block those URLs.



Why Google indexed the preview URL of domain?



I added this to .htacess with no success:



RewriteEngine On
RewriteCond %HTTP_HOST !^(www.)?example.com$
RewriteRule .* - [E=block:1]
Header set X-Robots-Tag "noindex,nofollow" env=block


How can I block Plesk temporary URLs from being indexed ?


Solution :

You need to test to ensure that each URL that appears in Google actually has the tag that you are expecting. I use cURL with the --head option for this type of testing.



curl --head 'http://temporaryurl.example.com/'


You want to make sure that the header include the expected line:



X-Robots-Tag: noindex,nofollow


Conversely, you should test to make sure it doesn't appear for your own domain name.



If this tag is indeed there, Google should not be indexing your temporary URLs (although it will crawl them to find the robots header information). I don't see anything obviously wrong with your rewrite rules, but my guess is that they are not working and you need to test them.



The easiest and most stable way is to 301 redirect the plesk pages to an alternative URL. So if you have a plesk page on your HTTPS URL then 301 redirect it to the HTTP URL.



Once Google sees this and processes it you will those pages removed from the index.



www.example.com will need replacing with your real URL.



You could also try blocking the other URL's using robots.txt


Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.

Comments

Popular posts from this blog

Rewrite in Mediawiki, remove index.php, .htaccess

.htaccess rewrite wildcard folder paths from host

Using .htaccess to set a cookie and 301 redirect