Improved `mod_rewrite` check

see https://github.com/open-classifieds/openclassifieds2/issues/845#issuecomment-49769990 

added extra tests & refacto