Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
apache:redirect-non-www-to-www [2010-06-22 23:06:22]
garrett.plasky created
apache:redirect-non-www-to-www [2019-09-06 19:27:15]
shaun.reitan
Line 1: Line 1:
 ====== Redirect non-www Traffic to www Using mod_rewrite ====== ====== Redirect non-www Traffic to www Using mod_rewrite ======
  
-This is an example using the mod_rewrite Apache module to force all traffic to your site to www.yourodmain.com. This can be useful in an SSL context, as well as for SEO purposes. Create a .htaccess file in your webroot (public_html for cPanel servers) and add the following lines:+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 webroot (public_html for cPanel servers) and add the following lines:
  
 <code> <code>
Line 8: Line 8:
 RewriteRule (.*) http://www.your-domain.com/$1 [R=301,L] RewriteRule (.*) http://www.your-domain.com/$1 [R=301,L]
 </code> </code>
- 
-{{tag>apache how-to}}