From "domain.com" to "domain.com/blog"

Discussion in 'Apache' started by squarehippies, Jan 1, 2008.

  1. #1
    I have a website at domain.com of which the static pages are indexed thoroughly by Google. I recently reindexed all the pages in Wordpress and it was installed in domain.com/blog.

    How do I tell Google via htaccess to go from all pages in domain.com site e.g "domain.com/folder/subfolder/page.shtml" or "domain.com/folder/" except the "domain.com/forum" to the new website at "domain.com/blog"? What is the safest way that won't hurt SEO and preserve my rank in SR? Thanks in advance!
     
    squarehippies, Jan 1, 2008 IP
  2. hostingcoupon

    hostingcoupon Peon

    Messages:
    447
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteCond %{REQUEST_FILENAME} !^forum/?$
    rewriteRule (.*) http://domain.com/blog/$1 [R=301,L]
     
    hostingcoupon, Jan 1, 2008 IP
  3. squarehippies

    squarehippies Peon

    Messages:
    166
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    squarehippies, Jan 1, 2008 IP
  4. hostingcoupon

    hostingcoupon Peon

    Messages:
    447
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Have you added RewriteEngine on ? :)
     
    hostingcoupon, Jan 1, 2008 IP
  5. squarehippies

    squarehippies Peon

    Messages:
    166
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    No, I just delete everything in the htaccess and replace it with your given code. How to I add that to the lines? Here is the current content of htaccess before modification. I currently use .shtml for all my static pages, hence the includes, etc and use PHP files as include. I guess these can be omitted since the Wordpress files are all PHP right? Thanks so much!

     
    squarehippies, Jan 2, 2008 IP
  6. hostingcoupon

    hostingcoupon Peon

    Messages:
    447
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Please try this:

     
    hostingcoupon, Jan 2, 2008 IP
  7. squarehippies

    squarehippies Peon

    Messages:
    166
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi again, it seems to work! :D But one last thing, all my "recent topics" i.e the included php snippet from the forum came out weird. Is that because some of the existing

    and

    I tried to remove either but the result is still the same. The recent topics section displays:
    I used this code to display 15 recent topics in the sidebar.

    You're really a great help! Thanks so much!
     
    squarehippies, Jan 2, 2008 IP