Improve regexp for robots.txt and deal more with php buffer