latorante tools

♥  Buy me a beer, or coffee :)

If found anything here usefull, and want to buy me a bevarage, I won't complain!

.htaccess redirect = non-www to www // www to non-www

non-www to wwww

        RewriteEngine On
        RewriteCond %{HTTP_HOST} !^www\.
        RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

www to non-www

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