How to block all pages except home with robots.txt?

How to block all pages except home with robots.txt?

by Ian L -
Number of replies: 1

I just moved moodle from a subdomain to a subcategory.


I want the engines to crawl the page mysite.com/moodlehomepage, but not any other pages.

So for example, block /login.index.php & other url's after moodlehomepage/

Anybody know how to do this with robots.txt?

Average of ratings: -
In reply to Ian L

Re: How to block all pages except home with robots.txt?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I've not tried it, but something like

Allow /?redirect=0
Disallow /

...or whatever your Moodle path is. I don't think all crawlers support Allow though. Sounds like more bother than it's worth though. In reality most pages are inaccessible anyway.