Tag Archives: mod_rewrite

.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. Continue reading .htaccess – Redirect non-www to www Subdomain

Apache – Redirect non www to www using VirtualHost setting

We can use .htaccess to redirect http://example.com to http://www.example.com by using the rewrite engine. But i find another simple way to implement the redirection just by setting up a VirtualHost.

Assume you have the current VirtualHost setting as follow. Continue reading Apache – Redirect non www to www using VirtualHost setting