: How to block certain URL from robots.txt file? 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/
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: www.example.com/sitemap.xml
I want all bots to follow my site but they should not follow these URLs:
www.example.com/phpmyadmin/..... http://www.example.com/login/..... www.example.com/newsletter/..... www.example.com/articlesubmission/.....
My doubt: Is my above robots.txt code is correct?
I followed this code from StackOverflow robots.txt.
More posts by @Margaret670
1 Comments
Sorted by latest first Latest Oldest Best
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
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.