Improved htaccess handling