====== Apache ======
===== .htaccess =====
Redirect requests to https
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
Rewrite ''domain.com/index.php?page=X'' routes as ''domain.com/X''
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?page=$1 [QSA]
===== Virtual hosts =====
In order to redirect the ''www'' subdomain for a domain ''sternfoundation.org'', one has to edit ''httpd-vhosts.conf''
ServerName www.sternfoundation.org
Redirect permanent / https://sternfoundation.org
To use SSL certificate on a domain ''www.sternfoundation.org'' in Apache one has to generate the certificate ''sternfoundation.crt'' and the key ''sternfoundation.key'' first.
DocumentRoot "/home/bitnami/htdocs/.sternfoundation"
ServerName www.sternfoundation.org
SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/sternfoundation.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/sternfoundation.key"
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
# Other directives here