.htaccess – Redirect non-www to www Subdomain

If you can’t edit the Apache configuration, you can do the redirection by setting up a virtual host as discussed in the post below.
Apache – Redirect non-www to www Subdomain

Or if you can add the following lines in the webroot .htaccess for the redirection.

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^ykyuen\.com$
RewriteRule ^(.*) http://www.ykyuen.com/$1 [R=301]

 

Done =)

Reference: StackOverflow – How to redirect non-www to www URL’s using htaccess?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.