Cohan

Stuff and things

No “www” – htaccess redirect

2017-08-04 1 min read Cohan Robinson

I go just long enough between websites that I’m always forgetting this little number. Putting it here so I can just grab it next time.

	RewriteEngine On
	RewriteBase /
	RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
	RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]