Useful notes & manuals
from the
world wide web
L:
P:
Register now!
Redirect only certain files with .htaccess Unsorted
Solution from: http://codesnippets.joyent.com/tag/htaccess Created by tlw on 13.10.2024 @ 04:31

<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 ^(.*)$ https://securesiteurl.com/$1 [R=301,L]

</IfModule>

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