I have multiple purchase pages with the same content like:
product1red.php
product2green.php
Should I block them with robots.txt ?
No need of blocking just need to use canonical
URLs.
You can consider any of the one link as canonical parent (Means original). and other one as duplicate.
You can just point one URL as its original, SEO Crawlers will identify that.
Use something like:
<link href="http://sample.com/product1red.php" rel="canonical" />
For this page:
http://sample.com/product2green.php