How to use .htaccess for Redirection
by Haris on July 21, 2007
in Internet, Technology, Tips and Tricks
Recently, when I had a domain change, I needed something in order to transfer all of my traffic from the old domain to the new one. So I used .htaccess for the redirection.
You can also use this, by typing the following in your .htaccess:
RewriteEngine OnRewriteCond %{HTTP_HOST} ^.*oldwebsite.com$ [NC]
RewriteRule ^(.*)$ http://www.preferredwebsite.net/$1 [R=301,L]
Replace oldwebsite.com with the current website and replace http://www.preferredwebsite.net with the new website URL where you want to redirect the traffic to.
If you want to know what did I used for my old domain, then see below:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sizzledcore.uni.cc$ [OR]
RewriteCond %{HTTP_HOST} ^www.sizzledcore.uni.cc$
RewriteRule ^(.*)$ http://www.sizzledcore.com [R=301,L]




Share Tweet