Skip to content

Instantly share code, notes, and snippets.

@joostvanveen
Last active November 15, 2015 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joostvanveen/768ebbdb61f65ba901b7 to your computer and use it in GitHub Desktop.
Save joostvanveen/768ebbdb61f65ba901b7 to your computer and use it in GitHub Desktop.
Canonical redirect in .htaccess - force www. prefix on domain
# Canonical redirect - force www. prefix on domain
RewriteCond %{HTTP_HOST} ^mydomain\.nl$ [NC]
RewriteRule ^(.*)$ https://www.mydomain.nl/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment