RewriteEngine On RewriteBase /oak/ # redirect to HTTPS RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # redirect to docs subdirectory # in a per directory context this is always matched against RewriteRule ^(index\.html)?$ /oak/docs/ [R=302,L]