Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 33

redirect non-www to www

This is a discussion on redirect non-www to www within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi, I want to put a code that redirects non-www to www. Is that bad and is it bad for ...

  1. #1
    Member
    Join Date
    Nov 2005
    Posts
    90
    Liked
    0 times

    redirect non-www to www

    Hi,

    I want to put a code that redirects non-www to www. Is that bad and is it bad for vbseo?

  2. #2
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    12 times

    Re: redurect non-www to www

    It's good.

  3. #3
    Senior Member
    Real Name
    Michael
    Join Date
    Oct 2005
    Posts
    1,755
    Liked
    1 times
    Blog Entries
    1

    Re: redurect non-www to www

    What is the best way to go about doing that?

  4. #4
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    12 times

    Re: redurect non-www to www

    In your root .htaccess, and in your forums .htaccess:

    Code:
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com 
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
    Make sure it's above your other RewriteCond's in both files, but under the RewriteEngine On.

  5. #5
    Senior Member
    Real Name
    Michael
    Join Date
    Oct 2005
    Posts
    1,755
    Liked
    1 times
    Blog Entries
    1
    Outstanding, thanks!

    I am probably learning more from this forum that any other one I have been on. And I definately have alot to learn.

  6. #6
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    12 times
    (See edit above.)

  7. #7
    Senior Member
    Real Name
    FAA Zooman
    Join Date
    Dec 2005
    Location
    Cumbria, UK
    Posts
    208
    Liked
    0 times
    Code:
     
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
    In forums .htaccess it will need the forum path?

    Code:
     
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/fourmpath/$1 [R=301,L]
    otherwise it will push it back to the homepage.

  8. #8
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    12 times
    Correct. I forgot to differentiate.

  9. #9
    Senior Member
    Real Name
    FAA Zooman
    Join Date
    Dec 2005
    Location
    Cumbria, UK
    Posts
    208
    Liked
    0 times
    Code:
     
    
    #root .htaccesss 
    RewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/$1 [R=301,L]
    Code:
     
    
    #forum .htaccesss 
    RewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/forum/$1 [R=301,L]


    Last edited by Ashley; 12-28-2005 at 09:38 PM.

  10. #10
    Senior Member
    Real Name
    Michael
    Join Date
    Oct 2005
    Posts
    1,755
    Liked
    1 times
    Blog Entries
    1
    well, it worked for my forum, but not for my root.

  11. #11
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    12 times
    Worked for me when I went to http://sportsoutlaw.com

  12. #12
    Senior Member
    Real Name
    FAA Zooman
    Join Date
    Dec 2005
    Location
    Cumbria, UK
    Posts
    208
    Liked
    0 times
    show us whats in your root .htaccess

  13. #13
    Senior Member
    Real Name
    FAA Zooman
    Join Date
    Dec 2005
    Location
    Cumbria, UK
    Posts
    208
    Liked
    0 times
    Quote Originally Posted by ConqSoft
    Worked for me when I went to http://sportsoutlaw.com
    And me.

  14. #14
    Senior Member
    Real Name
    Michael
    Join Date
    Oct 2005
    Posts
    1,755
    Liked
    1 times
    Blog Entries
    1
    Code:
    # -FrontPage-AddType application/x-httpd-php .php .htm .htmlIndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*order deny,allowdeny from allallow from allorder deny,allowdeny from allAuthName www.sportsoutlaw.comAuthUserFile /home/sportsou/public_html/_vti_pvt/service.pwdAuthGroupFile /home/sportsou/public_html/_vti_pvt/service.grpRewriteEngine onRewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/$1 [R=301,L]RewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com/.*$      [NC]RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com$      [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com/.*$      [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com$      [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com/.*$      [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com$      [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com/.*$      [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com$      [NC]RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

  15. #15
    Senior Member
    Real Name
    Michael
    Join Date
    Oct 2005
    Posts
    1,755
    Liked
    1 times
    Blog Entries
    1
    # -FrontPage-AddType application/x-httpd-php .php .htm .htmlIndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*order deny,allowdeny from allallow from allorder deny,allowdeny from allAuthName www.sportsoutlaw.comAuthUserFile /home/sportsou/public_html/_vti_pvt/service.pwdAuthGroupFile /home/sportsou/public_html/_vti_pvt/service.grpRewriteEngine onRewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/$1 [R=301,L]RewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com$ [NC]RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Redirecting non-www to www version
    By DN lodge in forum General Discussion
    Replies: 2
    Last Post: 03-16-2008, 12:47 PM
  2. Redirect index.php?blablablabla
    By googledave in forum Custom Rewrite Rules
    Replies: 9
    Last Post: 02-06-2006, 09:45 PM
  3. Best way to redirect my old forum to vb using 301
    By Bellinis in forum General Discussion
    Replies: 11
    Last Post: 10-29-2005, 10:03 PM

Posting Permissions

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