fix #731

Problem was with rewrite rule handling and the pages rewrite rule