1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

301 Redirect Help needed

Discussion in 'White Hat SEO' started by IamBlackhatter, Oct 5, 2013.

Thread Status:
Not open for further replies.
  1. IamBlackhatter

    IamBlackhatter Elite Member

    Joined:
    Feb 26, 2011
    Messages:
    2,538
    Likes Received:
    1,458
    Gender:
    Male
    Occupation:
    Software Developer
    Location:
    india
    ---- THREAD CLOSED 10/07/2013 ----
    I have searched in web also here in BHW to do a 301 redirect but still i couldn't make it

    Well i have set a preferred domain in webmaster tools and now i want to redirect my non www to www and here's the code i have used for redirecting using .htaccess file

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    I got this from web not sure if the code is correct but the problem is still my site not getting redirected to www it is sticked with non www but sometimes only the main domain redirects to www but all my inner pages give me 404 page not found error ?I have changed my site/wordpress url to www version.Is there anything that i have to move all my files to new location ? or is there any wrong in the code any help would be appreciated thanks in advance :)
     
  2. Seo Lover

    Seo Lover Jr. Executive VIP Jr. VIP

    Joined:
    Jan 30, 2011
    Messages:
    5,898
    Likes Received:
    4,214
    Gender:
    Male
    Occupation:
    Hanging Around Interawebs !
    Location:
    <-----------------Sin City
    Gorang is your man , he has shared good stuff related to 301 redirects

    Read his posts
     
    • Thanks Thanks x 1
  3. Dvarmin

    Dvarmin Regular Member

    Joined:
    Dec 21, 2012
    Messages:
    346
    Likes Received:
    234
    Have you tried the code bellow, it always works for me:
     
  4. fioskay

    fioskay BANNED BANNED

    Joined:
    Aug 26, 2013
    Messages:
    15
    Likes Received:
    2
    here you go attached pic if you please. i kinda like this site, i can just be helpful around here...sorry bro, i can get you the scipt becase they keep pingin me for a site violation and the pic upload seems to be down. but if you want to skype me at seo_mcadams1 i will send it to you hot off the press, 301 redirect and a forward to a 404 for all pages not found basically exactly what ever site would need.
     
  5. keizer

    keizer Regular Member

    Joined:
    Oct 22, 2008
    Messages:
    397
    Likes Received:
    398
    Yes, it is the code. Use this one.
     
Thread Status:
Not open for further replies.