Page 18 of 18 FirstFirst ... 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Results 256 to 268 of 268
Like Tree3Likes

[How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects

This is a discussion on [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects within the General Discussion forums, part of the vBSEO SEO Plugin category; Can someone tell me how to redirect all pages from www. to non www version of my website ? mybetinfo.net ...

  1. #256
    Member
    Real Name
    Cadar Marius Florin
    Join Date
    Sep 2010
    Posts
    91
    Liked
    3 times
    Can someone tell me how to redirect all pages from www. to non www version of my website ? mybetinfo.net is the website, now i can access with www and without www ... i guess htis i not good at all.
    I like vbseo i use it on sports betting and whatafy.com

  2. #257
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    Please check first post of the thread. It has required code.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #258
    Member
    Real Name
    Cadar Marius Florin
    Join Date
    Sep 2010
    Posts
    91
    Liked
    3 times
    Forgive me maybe i'm complety blind, but there says pretty big ONLY for domain, i need for all pages, when i access www page to redircet me on non www version

    Look i can access : Mybetinfo.net - Betsson - Be the expert !
    and Mybetinfo.net - Betsson - Be the expert !

    same last article one with www and another without, i need when i enter the url of www to redirect to non www, where to put the code and what code, please help me.

    EDIT,

    i edited htaccess and put those lines, seems is ok for articles to, i thought is only for main link, sorry about that.
    I like vbseo i use it on sports betting and whatafy.com

  4. #259
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    It will cover EVERYTHING, so long as there's not another htaccess file below it, as that file will take over.

  5. #260
    Member
    Real Name
    Galerio
    Join Date
    Jan 2011
    Posts
    47
    Liked
    4 times
    I use a WWW domain but I also setted up many subdomains (for CDN, for users, for blog.....) so I can't manually ad exception to htaccess for every new user that automatically gets its own subdomain. So I use thi rule to redirect only the second level domain (without www) to the www:

    Code:
    # check to make sure it's not a www or subdomain request
    RewriteCond %{HTTP_HOST} ^([^.]+\.com) [NC]
    # if that's the case, redirect to www.HTTP_HOST
    RewriteRule (.*) http://www.%1/$1 [R=301,L]
    In this way:

    site.com -> www.site.com
    cdn.site.com->cdn.site.com
    blog.site.com->blog.site.com
    username.site.com->username.site.com


    So only site.com is affected by this rule. Everything else pass.

    If your forum is on a subdirectory:
    www.site.com/forum
    then you must add the name of the firectory in the last line:
    Code:
    # check to make sure it's not a www or subdomain request
    RewriteCond %{HTTP_HOST} ^([^.]+\.com) [NC]
    # if that's the case, redirect to www.HTTP_HOST
    RewriteRule (.*) http://www.%1/forum/$1 [R=301,L]
    (note the final slash)

    Bye

  6. #261
    Senior Member
    Real Name
    gotlinks
    Join Date
    Jun 2006
    Posts
    202
    Liked
    5 times
    I have a 301 redirect, but I am still getting a 404 not found:
    can someone help fix this:


    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^vipmoneymakersclub.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.vipmoneymakersclub.com$
    RewriteRule ^(.*)$ "http\:\/\/www\.buyadtraffic\.com\/forum$1" [R=301,L]

    when I click on a link from google and it tries to 301, it looks as if it is missing a forward slash.....

  7. #262
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    Quote Originally Posted by gotlinks View Post
    I have a 301 redirect, but I am still getting a 404 not found:
    can someone help fix this:


    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^vipmoneymakersclub.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.vipmoneymakersclub.com$
    RewriteRule ^(.*)$ "http\:\/\/www\.buyadtraffic\.com\/forum$1" [R=301,L]

    when I click on a link from google and it tries to 301, it looks as if it is missing a forward slash.....
    Hello ,

    You can use following
    Code:
    RewriteCond %{HTTP_HOST} !^www\.vipmoneymakersclub\.com$
    RewriteRule (.*) http://www.vipmoneymakersclub.com/forum/$1 [R=301,L]
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  8. #263
    Senior Member
    Real Name
    gotlinks
    Join Date
    Jun 2006
    Posts
    202
    Liked
    5 times
    3


    Quote Originally Posted by Mert Gökçeimam View Post
    Hello ,

    You can use following
    Code:
    RewriteCond %{HTTP_HOST} !^www\.vipmoneymakersclub\.com$
    RewriteRule (.*) http://www.vipmoneymakersclub.com/forum/$1 [R=301,L]

  9. #264
    Junior Member
    Real Name
    Gary
    Join Date
    Sep 2011
    Posts
    1
    Liked
    0 times
    Hi,

    Is there any benefit to using the method in post 1 to remove the www. over the method below?

    Code:
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

  10. #265
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hi Gary,

    It may represent a problem if you would have a parked domain over your main one. I'm not quite sure if that code snippet 'eats' more resources than one one on the first post.

    I'd recommend not to use it though.
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  11. #266
    Junior Member
    Real Name
    Alan
    Join Date
    May 2011
    Posts
    27
    Liked
    2 times
    Just to ask.

    If I use this code:

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

    this would leave subdomains out of redirecting? As I specify www.site.com?

  12. #267
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    That says "if it starts with www ... move it to non-www"

    No subdomains will hit the rule.

    In general, you should use the negative case to block everything, and make exceptions for the ones that exist. See the 'Making Expceptions" heading in the first post.
    Alan_SP likes this.
    Brian Cummiskey / Crawlability Inc.
    Security vbulletin - Patch Level for all supported versions released!

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  13. #268
    Member
    Join Date
    Mar 2012
    Posts
    31
    Liked
    0 times
    Be sure to check your .htaccess in case the code is already there. It was in mine My site is indexed properly in Google as well.

Page 18 of 18 FirstFirst ... 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Similar Threads

  1. Urgent help with htaccess and 301 redirects
    By markbolyard in forum URL Rewrite Settings
    Replies: 4
    Last Post: 12-02-2007, 04:24 PM
  2. htaccess redirects when moving folder
    By I, Brian in forum Troubleshooting
    Replies: 3
    Last Post: 10-05-2007, 01:47 PM
  3. Help with initial htaccess setup
    By mhc1576 in forum URL Rewrite Settings
    Replies: 1
    Last Post: 12-28-2006, 06:44 AM
  4. Replies: 6
    Last Post: 10-23-2005, 12:32 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
  •