Photo by Remy_Loz on Unsplash

New Tutorials

New Projects

New Newsletter Issues

New Awesome Lists


Photo by Sora Sagano on Unsplash

Weekly Newsletters

New Tutorials

New Projects


Photo by Austin Distel on Unsplash

Photo by Freddy Castro on Unsplash

Example .htaccess Snippets

Ghost Platform Powered

Royce Theme

Bluffer’s Park and Beach (4K Video)


Photo by Anete Lūsiņa on Unsplash

Photo by Fotis Fotopoulos on Unsplash

Force www

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Force non-www

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.
RewriteCond %{HTTPS}s ^on(s)|off
RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www\.)?(.+)$
RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L]

Force HTTPS

RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
<IfModule mod_headers.c> # Remove "includeSubDomains" if you don't want to enforce HSTS on all…

Photo by Norbert Levajsics on Unsplash

What’s New

Updates


Photo by Clément Hélardot on Unsplash

Photo by Fotis Fotopoulos on Unsplash

Brandon Himpfen

Open source. Travel. Photography. https://www.himpfen.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store