Move rewrite condition to top

As @procrastinatio predicted, one never gets the apache configuration right the first time.

This needs to be on top.