+ Reply to Thread
Results 1 to 6 of 6

Thread: Apache Mod_rewrite: Non-WWW to WWW

  1. #1
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    4,838

    Default Apache Mod_rewrite: Non-WWW to WWW

    If you are on an Apache Server you can redirect the Non-WWW version of your site to the WWW version with this code in your .htaccess file:
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
    RewriteRule ^(.*)  http://www.yourdomain.com/$1 [L,R=301]
    Used Mobile Homes For Sale
    Used Manufactured Homes For Sale
    SalesPractice.com -The Definitive Source for Sales Education on the Internet. - Sales Training

  2. #2
    Join Date
    Oct 2004
    Location
    Florida
    Posts
    2,132

    Default Re: Apache Mod_rewrite: Non-WWW to WWW

    Thanks Jeffery. I thought I had mine set up right and low and behold it wasn't working properly anymore.
    Do you have one that can redirect "www.mysite.com/index.htm" to "www.mysite.com/"?

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    4,838

    Default Re: Apache Mod_rewrite: Non-WWW to WWW

    Quote Originally Posted by kyle422
    Do you have one that can redirect "www.mysite.com/index.htm" to "www.mysite.com/"?
    Code:
    RewriteRule ^index.htm$  http://www.mysite.com [L,R=301]
    Used Mobile Homes For Sale
    Used Manufactured Homes For Sale
    SalesPractice.com -The Definitive Source for Sales Education on the Internet. - Sales Training

  4. #4
    Join Date
    Oct 2004
    Location
    Florida
    Posts
    2,132

    Default Re: Apache Mod_rewrite: Non-WWW to WWW

    doesn't seem to work??
    Last edited by kyle422; 02-10-2005 at 08:07 AM.

  5. #5
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    4,838

    Default Re: Apache Mod_rewrite: Non-WWW to WWW

    That is a working mod_rewrite. Can you PM the contents of your .htaccess file?
    Used Mobile Homes For Sale
    Used Manufactured Homes For Sale
    SalesPractice.com -The Definitive Source for Sales Education on the Internet. - Sales Training

  6. #6
    Join Date
    Oct 2004
    Location
    Florida
    Posts
    2,132

    Default Re: Apache Mod_rewrite: Non-WWW to WWW

    on the way.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts