Skip to content

Instantly share code, notes, and snippets.

@amityweb
Last active November 2, 2018 20:02
Show Gist options
  • Save amityweb/3e1c7ca4a1dc1bea6e85836397606f5d to your computer and use it in GitHub Desktop.
Save amityweb/3e1c7ca4a1dc1bea6e85836397606f5d to your computer and use it in GitHub Desktop.
My .htaccess redirects for with or without www and with HTTPS
# REDIRECT TO WWW and HTTPS
#RewriteEngine On
#RewriteCond %{HTTP_HOST} !^www.domainname.co.uk$ [OR]
#RewriteCond %{SERVER_PORT} 80
#RewriteRule (.*) https://www.domainname.co.uk/$1 [R=301,L]
# REDIRECT TO WITHOUT WWW and HTTPS
#RewriteEngine On
#RewriteCond %{HTTP_HOST} !^domainname.co.uk$ [OR]
#RewriteCond %{SERVER_PORT} 80
#RewriteRule (.*) https://domainname.co.uk/$1 [R=301,L]
# Remove comments # for the one you want to use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment