Very Urgent (Need help in .htaccess file)

Discussion in 'Search Engine Optimization' started by bigapplecard, Sep 10, 2012.

  1. #1
    Hello Friends

    i am using following coding for my website

    Options +FollowSymLinks
    RewriteCond %{THE_REQUEST} ^.*/index.html
    RewriteRule ^(.*)index.html$ http://www.akalcity.in/$1 [R=301,L]

    ErrorDocument 404 /404.html



    but my website index.html page is not redirecting to www
     
    bigapplecard, Sep 10, 2012 IP
  2. nufox

    nufox Peon

    Messages:
    749
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Perhaps you can post this question to Wordpress.org forums. There'll be plenty of help you can get over there.
     
    nufox, Sep 10, 2012 IP
  3. bigapplecard

    bigapplecard Member

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #3
    My website is html based not WordPress

    can you give me proper link of WordPress forum
     
    bigapplecard, Sep 10, 2012 IP
  4. pandepanne

    pandepanne Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    what do you want to do exactly?
    You want redirect the url without www to the url with www. If you want to do this, use this code:
    RewriteEngine on
    rewritecond %{HTTP_HOST} ^your_website [nc]
     
    pandepanne, Sep 12, 2012 IP
  5. suwandichen13

    suwandichen13 Well-Known Member

    Messages:
    618
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    140
    #5
    you mean like this?
    redirect from yourdomain.com/index.html to yourdomain.com right?
    are you already try it with canonlizical your Page?
     
    suwandichen13, Sep 12, 2012 IP
  6. bigapplecard

    bigapplecard Member

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #6
    Exactly i want to redirect from yourdomain.com/index.html to www.yourdomain.com

    but unable to do ............... :(


     
    bigapplecard, Sep 12, 2012 IP
  7. suwandichen13

    suwandichen13 Well-Known Member

    Messages:
    618
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    140
    #7
    try this.

    <link rel="canonical" href="http://yourdomain.com/index.html" />
    put it on head section.
    if that work please kindly tell me..^^
     
    suwandichen13, Sep 12, 2012 IP
  8. pandepanne

    pandepanne Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #8
    you can try this (not tested):

    RewriteEngine on rewritecond %{HTTP_HOST} ^www.yourdomain.com [nc]
    RewriteRule ^yourdomain.com/index.html http://www.yourdomain.com [nc]
    RewriteRule http://yourdomain.com/index.html http://www.yourdomain.com [nc]
     
    pandepanne, Sep 12, 2012 IP
  9. suwandichen13

    suwandichen13 Well-Known Member

    Messages:
    618
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    140
    #9
    suwandichen13, Sep 12, 2012 IP
  10. pandepanne

    pandepanne Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #10
    no it's from none canoninal to www so left to right.
     
    pandepanne, Sep 12, 2012 IP
  11. suwandichen13

    suwandichen13 Well-Known Member

    Messages:
    618
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    140
    #11
    what you mean??i don't get it
     
    suwandichen13, Sep 12, 2012 IP
  12. pandepanne

    pandepanne Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #12
    if you know rewriterule in htaccess:
    • "RewriteRule ^yourdomain.com/index.html http://www.yourdomain.com" mean all the request like yourdomain.com/index.html rewrite in the adress url of the browser in url http://www.yourdomain.com
    • "RewriteRule http://yourdomain.com/index.html http://www.yourdomain.com" mean all the request http://yourdomain.com/index.htm is rewriting in the adress bar of the browser in http://www.yourdomain.com
     
    pandepanne, Sep 12, 2012 IP
  13. Charles.Roger

    Charles.Roger Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    this is what i use for my website and it works perfectly for me

    RewriteCond %{HTTP_HOST} !^www.reviewandmoney.com$ [NC]
    RewriteRule ^(.*)$ http://www.reviewandmoney.com/$1 [L,R=301]
    if you want any help please contact me at charlesroger @ reviewandmoney .com
     
    Charles.Roger, Sep 12, 2012 IP