.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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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