RewriteEngine On RewriteCond %{HTTPS} !On RewriteCond %HTTP_HOST} (.+) RewriteCond %{REQUEST_URI} !^/%HTTP_HOST} RewriteRule (.+) %{HTTP_HOST}/$1