RewriteEngine On RewriteCond %{HTTPS} ^$ RewriteRule (.*) https://domain.com/directory/$1 [L]