Quantcast
Channel: Eureka! » Apache
Viewing all articles
Browse latest Browse all 12

.htaccess – Redirect non-www to www Subdomain

$
0
0

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?


Filed under: Apache Tagged: .htaccess, Apache, mod_rewrite, Postaday2011

Viewing all articles
Browse latest Browse all 12

Trending Articles