Redirect non-www Traffic to www Using mod_rewrite

Home Forums Official Forum- Navsingh SSL Certificate (Https) How to ? Get all your answers on Https Redirect non-www Traffic to www Using mod_rewrite

This topic contains 0 replies, has 1 voice, and was last updated by  Nav Singh 2 years, 2 months ago.

  • Author
    Posts
  • #3207 Reply

    Nav Singh
    Keymaster

    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 http://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:

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

Reply To: Redirect non-www Traffic to www Using mod_rewrite
Your information:




Official Forum

This is the Official Forum of Navsingh a community that helps you find answers to all of your problems,they can be Java/programming,wordpress,android, android programming, seo related or technology related