Mobile app version of vmapp.org
Login or Join
Margaret670

: 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/

@Margaret670

Posted in: #RobotsTxt

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme