Move rewrite condition to top
Merge pull request #1142 from geoadmin/dev_fix_apache_for_main

Move rewrite condition to top