Common .htaccess rewrite commands
Attention: Do not attempt to edit your .htaccess file if you have no previous experience, or you can significantly degrade your site.
Force SSL for the entire site or directory
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Rewrite base directory into a sub-directory
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteRule ^$ http://%{HTTP_HOST}/subfolder/index.php [R,L]
Route requests through PHP-based dispatcher
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/dispatcher.php RewriteRule (.*) /dispatcher.php%{REQUEST_URI} [L]