1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

permanent Redirect /%postname%/.html to /%postname%.html

Discussion in 'WordPress' started by Vebtools, Jul 9, 2010.

  1. #1
    Hi Guys!

    Few month ago i mistakenly write /%postname%/.html instead of /%postname%.html

    but now if i make it correct like /%postname%.html then the result on google redirect to "page not found page"

    can any body tell me what to write in my .htaccess file to redirect my url from google /%postname%/.html to /%postname%.html
     
    Vebtools, Jul 9, 2010 IP
  2. larssonk22

    larssonk22 Well-Known Member

    Messages:
    236
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #2
    First line of the .htaccess write

    Redirect "original url" "new url"

    that should work (remove quotes)
     
    larssonk22, Jul 10, 2010 IP
  3. bvraghav

    bvraghav Member

    Messages:
    123
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #3
    bvraghav, Jul 10, 2010 IP
  4. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #4
    This is because of your have not redirected your old url to new one. Just add this line in your htaccess:

    Redirect 301 /%postname%/.html http://www.yourdomainname.com/%postname%.html

    and your post would work fine.
     
    manish.chauhan, Jul 12, 2010 IP
  5. Vebtools

    Vebtools Well-Known Member

    Messages:
    2,619
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    145
    #5


    should i have to redirect each and every url like this?
     
    Vebtools, Jul 12, 2010 IP
  6. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #6
    yes, you need to redirect all pages.
     
    manish.chauhan, Jul 12, 2010 IP
  7. Vebtools

    Vebtools Well-Known Member

    Messages:
    2,619
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    145
    #7
    is there any fast solution?

    plz let me know the complete coding if i have to change the each link
     
    Vebtools, Jul 13, 2010 IP
  8. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #8
    Let me know the urls that you need to redirect so that can provide you with the exact code.
     
    manish.chauhan, Jul 13, 2010 IP
  9. Vebtools

    Vebtools Well-Known Member

    Messages:
    2,619
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    145
    #9
    Vebtools, Jul 13, 2010 IP
  10. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #10
    manish.chauhan, Jul 13, 2010 IP
    Vebtools likes this.
  11. Vebtools

    Vebtools Well-Known Member

    Messages:
    2,619
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    145
    #11


    no it is not working :( when i click on my old URL through google, it take me to page can not found page :(



    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Redirect 301 /real-inspiration/.html http://www.hulsestrength.com/real-inspiration.html
     
    Vebtools, Jul 14, 2010 IP
  12. subdivisions

    subdivisions Well-Known Member

    Messages:
    1,021
    Likes Received:
    40
    Best Answers:
    1
    Trophy Points:
    145
    #12
    Why did you add fake file extensions anyway? It just looks messy to human eyes and search engines.

    To answer your question, you'll have to manually redirect each post with htaccess's "Redirect 301"

    Redirect 301 /old-url/.html http://newurl.com/post.html
    Code (markup):
     
    subdivisions, Jul 14, 2010 IP
  13. Vebtools

    Vebtools Well-Known Member

    Messages:
    2,619
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    145
    #13

    i did and it is not working :(
     
    Vebtools, Jul 14, 2010 IP
  14. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #14
    You may need to contact your hosting provider and confirm that you have Apache's Mod-Rewrite Rules enabled.
     
    manish.chauhan, Jul 15, 2010 IP