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 two sites I am currently working on which is a shopping cart and another shopper...Both are under the same domain name so for example


Both these urls have tons of pages below them



How do I disallow the main url /first_url and /second_url to and all the subpages and sub directories ...I was thinking something like this but I don't know if this works or not and whether it was the correct syntax

Disallow: /first_url/*/
Disallow: /second_url/*/
share|improve this question

migrated from stackoverflow.com Jul 15 '11 at 19:49

This question came from our site for professional and enthusiast programmers.

I think your syntax is right but not sure about the extra / – Alex Jul 15 '11 at 16:03
up vote 8 down vote accepted

You don't need the trailing slash to block those directories. This will work:

Disallow: /first_url/*
Disallow: /second_url/*

This Google help page covers this quite well.

share|improve this answer
You can just do "Disallow: /first_url". The trailing wildcard is ignored. According to developers.google.com/webmasters/control-crawl-index/docs/… – Evgenii Jun 10 '14 at 23:44
You need Disallow: /url/* to match things like example.com/url/test?test=1 – Gareth Daine Dec 11 '14 at 15:05

Your Answer


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