Sometimes we find it really difficult to redirect from a main or primary domain to the subdomain of the same primary domain using .htaccess.

For example if you want to redirect from http://www.lynda.com to http://new.lynda.com

To achieve this, just grab this snippet and paste it in the .htaccess file in the root of your primary domain.

 

RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^(www\.)?lynda\.com$ [NC]
RewriteRule ^ http://new.lynda.com [R,L]

 

Post your comments below.

 

Spread the love
  • 2
  •  
  •  
  • 3
  •  
  •  
  •  
  •  
    5
    Shares