Useful notes & manuals
from the
world wide web
Register now!
Redirect only certain files with .htaccess Unsorted
Solution from: Created by tlw on 29.11.2020 @ 00:58

<IfModule mod_rewrite.c>

RewriteEngine On

# Force removal of www
RewriteCond % ^www\.(.+)$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# (Or force addition of www depending on your cert)
RewriteEngine On
RewriteCond % !^www\.
RewriteRule ^(.*)$ http://www.%/$1 [R=301,L]

# Now Force traffic to use HTTPS
RewriteCond % !443
RewriteRule ^(.*)$$1 [R=301,L]


RewriteEngine   non   www   htaccess
Created by THE LOST WEB © 2009-2012