Move special behavior from apache config to script and .htaccess