sandalian.com


Redirect Non-WWW to WWW using htaccess

16 February 2012 20:51:37 WIB, under category Technical Stuffs

I’m using this script very often, for some customers to redirect their website from domain.com to www.domain.com. So I will put it here for easy access.

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

Just create or insert above script into your .htaccess. When a visitor visits domain.com he will be forwarded to www.domain.com.

Piece of cake.


Only 1 comment for now..

  1. zasłony
    21 February 2015, 15:32:17 WIB

    If some one wishes to be updated with latest technologies then he must
    be visit this site and be up to date everyday.

RSS for comments TrackBack URL

Leave a comment or two

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>