Since there are no other plain HTTP virtual hosts, the one defined for chmod777.sh became the "default." Since it explicitly redirects all requests to https://chmod777.sh, it caused all non-HTTPS requests to be redirected there, regardless of the requested name. This was particularly confusing for Tabitha, as she frequently forgets to put https://…, and would find herself at my stupid blog instead of Nextcloud.
22 lines
598 B
Plaintext
22 lines
598 B
Plaintext
<VirtualHost _default_:443>
|
|
ServerName chmod777.sh
|
|
ServerAlias blog.chmod777.sh www.chmod777.sh
|
|
|
|
RewriteEngine On
|
|
RewriteCond %{SERVER_NAME} !^chmod777\.sh
|
|
RewriteRule (.*) https://chmod777.sh$2 [R=301,L]
|
|
|
|
Include conf.d/ssl.include
|
|
SSLCertificateKeyFile /etc/pki/tls/private/chmod777.sh.key
|
|
SSLCertificateFile /etc/pki/tls/certs/chmod777.sh.cer
|
|
|
|
<IfModule mod_headers.c>
|
|
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
|
|
</IfModule>
|
|
|
|
DocumentRoot /srv/www/chmod777.sh/htdocs
|
|
<Directory /srv/www/chmod777.sh/htdocs>
|
|
Require all granted
|
|
</Directory>
|
|
</VirtualHost>
|