Let's assume we are using pretty URLs with mod_rewrite
or something similar and have the following two routes:
/page
/page-two
Now we want to disallow only the first route (/page
) to be crawled by robots.
# robots.txt
User-agent: *
Disallow: /page
Disallow (http://www.robotstxt.org/orig.html):
... For example, Disallow: /help disallows both /help.html and /help/index.html, whereas Disallow: /help/ would disallow /help/index.html but allow /help.html.
So the above robots.txt
example is disallowing /page-two
too, correct?
What is the correct way to get this done?
May it be the following code?
# robots.txt
User-agent: *
Disallow: /page/