Skip to content

Instantly share code, notes, and snippets.

@S-n-d
S-n-d / .htaccess
Last active January 25, 2023 08:59
[htaccess] #htaccess
# force https + www to non-www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
# redirect olddomain.be to newdomain.be
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.be$ [OR]