Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have main domain example.com and subdomain called static.example.com that serves images and other static content. It's once hosted whole domain (example.com), but I moved main domain to other server but all files/scripts/software remained on static.example.com.

Several days ago, I've noticed that Google indexed it and all of the content is the same as on original domain:


How can I remove static.example.com indexed pages only (leave images and other static content)? Will this be OK:

1) I've uploaded this robots.txt:

User-agent: googlebot-image
User-agent: *
Disallow: /

2) Removed all software/scripts from the site so it's now showing 404. Will 301 redirect be more appropriate?

share|improve this question
up vote 1 down vote accepted

I've had this happen before when running a test.mysite.com subdomain, in that instance I didn't actually need to keep the sub domain so I just deleted it, and it slowly got removed from Google.

What I'd suggest is to make a Google Webmaster Tools profile for the subdomain (separate from the main domain's profile), and then once that's set up go to Google Index > Remove urls (in the side bar) and try removing the pages that you've found indexed.

Again in Webmaster Tools go to 'Crawl > Blocked urls' and see that its reading your robots.txt file correctly; this way you'll be able to see that Google knows to explicitly block your URL.

The only other option I could think of would be to somehow block access to the subdomain to everyone apart from your main site, using .htaccess (I'm not sure exactly the process for this, but someone on here should be able to point you in the right direction).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.