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

This is simple question but also I have a confusion.

Below is the code which I wrote in my robots.txt:

User-Agent: *
Disallow: /phpmyadmin/  
Disallow: /login/
Disallow: /newsletter/
Disallow: /articlesubmission/  
Allow: /

Sitemap: http://www.example.com/sitemap.xml

I want all bots to follow my site but they should not follow these URLs:


My doubt: Is my above robots.txt code is correct?
I followed this code from StackOverflow robots.txt.

share|improve this question

closed as off-topic by Stephen Ostermiller Jul 26 '13 at 21:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because it is unlikely to help anybody else. Examples include individual website reviews for SEO purposes and general website troubleshooting." – Stephen Ostermiller
If this question can be reworded to fit the rules in the help center, please edit the question.

Yes, your robots.txt is correct. – Zistoloen Jul 26 '13 at 8:52
@Danny Looks good :-) – dan Jul 26 '13 at 8:57
@Danny Based on the amazingly quick crawling and indexing StackOverflow receives, I don't think their webmaster is wrong ;-) – dan Jul 26 '13 at 15:17
@Zistoloen thank you for the confirmation. – Ashu Jul 26 '13 at 15:52
@dan Thanks dan. I was little bit confused with this that's why though to ask you – Ashu Jul 26 '13 at 15:53

Yes, you have defined your entries correctly.

Just to be clear, adding the name of a directory with a trailing slash will block that directory and everything within it; including if there is a live page on the directory address.

However your Allow: / is superfluous and will have no effect as you are already allowing the entire site apart from the directories you have disallowed, so this entry should be removed.

You can find more info on how robots.txt works with Google here: Robots.txt Specifications

share|improve this answer
Thank you for your answer.Now i understood. I am very confusing person. – Ashu Jul 26 '13 at 15:50

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