BIP KB:
How To Redirect Non-www Traffic To www Using mod_rewrite
Article By tasia
![]() |
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: don't wait to educate, apache webserver, Redirect, mod rewrite, mod_rewrite
Spin Up A VPS Server In No Time Flat
Simple Setup
Full Root Access
Straightforward Pricing
DEPLOY A SECURE VPS SERVER TODAY!Leave a Reply
Feedbacks
![]() This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. |