Help to rightly create robots.txt
I have dynamic urls like this.
mydomain.com/?pg=login
mydomain.com/?pg=reguser mydomain.com/?pg=aboutus mydomain.com/?pg=termsofuseWhen the page is requested for ex. mydomainname.com/?pg=login index.php include login.php file.
some of the urls are converted to static url like mydomain.com/aboutus.html mydomain.com/termsofuse.html
I need to allow index mydomainname.com/aboutus.html, mydomainname.com/termsofuse.html and disallow mydomainname.com/?pg=login, mydomainname.com/?pg=reguser, please help to manage my robots.txt file.
I have also mydomainname.com/posted.php?deta开发者_StackOverflow社区ils=50 (details can have any number) which I converted to mydomainname.com/details/50.html I need also to allow all this type of urls.
If you wish to only index your static pages, you can use this:
Disallow: /*?
This will disallow all URLs which contain a question mark.
If you wish to keep indexing posted.php?details=50 URLs, and you have a finite set of params you wish to disallow, you can create a disallow entry for each, like this:
Disallow: /?pg=login
Or just prevent everything starting with /?
Disallow: /?*
You can use a tool like this to test a sampling of URLs to see if it will match them or not.
http://tools.seobook.com/robots-txt/analyzer/
精彩评论