How To Redirect Non-www Traffic To www Using mod_rewrite

Article By: tasia


img

Apache mod rewrite for BIP media VPS This is an example using the mod_rewrite Apache module to force all traffic to your site to www.yourdomain.com .

This can be useful in an SSL context, as well as for SEO purposes. Create a .htaccess file in your web root (public_html for cPanel servers) and add the following lines:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^your-domain.com
RewriteRule (.*) http://www.your-domain.com/$1 [R=301,L]



Tags: , , , ,


Welcome to the healthcare-only HIPAA - GDPR compliant cloud. Exclusively hosted on a HPC environment!

Learn more or start today by choosing your secure HIPAA - GDPR compliant server's Operating System bellow and pick the package that's best for you.

BIPmd makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine, thousand or more.



Windows VPS options and add ons
Linux VPS options and add ons

>

Looking for a custom solution?

Our technicians can provide you with the best custom-made solutionss on the market, no matter whether you're a small business or large enterprise.

Get in touch

Leave a Reply



Feedbacks