Redirect non www to www Using .htaccess


Prev Tutorial Next Tutorial

How to Redirect Old Domain to New Domain Using .htaccess File

This is helpful when you want to change your domain name without lose your website traffic from search engine.

Syntax

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

Prev Tutorial Next Tutorial

Download Projects

Google Adsense Advertisements
Free Classified Site – Bedpage

Yahoo Advertisements