Mobile app version of vmapp.org
Login or Join
Cofer257

: Robots.txt: block all webpages except a few number of webpages? I have a few doubts regarding robots.txt. Say, my domain is stackoverflow.com, A) Will the code below do the following for all

@Cofer257

Posted in: #RobotsTxt

I have a few doubts regarding robots.txt. Say, my domain is stackoverflow.com,

A) Will the code below do the following for all the crawlers?

User-agent: *

Disallow: /

Allow: /$
Allow: /a/$
Allow: /a/login.php
Allow: /a/login.php?return=/pligg/



Accepting stackoverflow.com/ will accept stackoverflow.com too?
Accepting stackoverflow.com/a/ Accepting stackoverflow.com/a/login.php Accepting stackoverflow.com/a/login.php?return=/pligg/ Not accepting any other page on stackoverflow.com

B) Which is right: robots.txt or robot.txt?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cofer257

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

Your robots.txt is invalid. Line breaks are not allowed in a record. So it should look like:

User-agent: *
Disallow: /
Allow: /$
Allow: /a/$
Allow: /a/login.php
Allow: /a/login.php?return=/pligg/



Will the code below do the following for all the crawlers?


No, your robots.txt won’t work that way for all crawlers.

Allow is not part of the original robots.txt specification. Only some parsers will understand it (and they might have implemented the wildcards differently), all other parsers will ignore the Allow lines.

10% popularity Vote Up Vote Down


 

@BetL925

A) Yes for the most important ones (Googlebot...).


Yes


B) The right file name is robots.txt.

Otherwise, the right code to do what you want is the following:

User-agent: *

Disallow: /

Allow: /a/$
Allow: /a/login.php
Allow: /a/login.php?return=/pligg/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme