Changed my whole site to another dir, need help

Discussion in 'Apache' started by Jim_Westergren, Nov 24, 2005.

  1. #1
    Hi!

    I had a site on domain.com that is now moved to domain.com/folder/ and on domain.com there is now a blog.

    What do I need to write in the .htaccess to make the 301 of old to new URLs but still getting the blog indexed?

    Thanks!
     
    Jim_Westergren, Nov 24, 2005 IP
  2. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you would have to 301 the old directory folders like

    .com/sports 301 to .com/dir/sports

    and do the same for every thing apart from homepage.

    check out the faq by nintendo at top of apache/htaccess forum
     
    just-4-teens, Nov 24, 2005 IP
  3. Jim_Westergren

    Jim_Westergren Notable Member

    Messages:
    1,882
    Likes Received:
    247
    Best Answers:
    0
    Trophy Points:
    235
    #3
    Hmm but it was not on a folder before.

    And if I do "domain.com 301 to domain.com/dir/" my home page with the new blog cannot be reached.
     
    Jim_Westergren, Nov 24, 2005 IP
  4. Dejavu

    Dejavu Peon

    Messages:
    916
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Looks to me you got only 2 choices:
    Either you have to rewrite each page of your old site (as just-for-teens suggested), of will have to rewrite everything, *except* the new blog pages.
    In the second case you must use
    RewriteCond %{REQUEST_URI} !(newblogpage.htm)
    RewriteRule etc etc
    to ignore the new pages.
    Either way this is a conundrum
     
    Dejavu, Nov 24, 2005 IP
  5. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #5
    how did the script output categories?
    was it something like index.php?cat2??

    if it was you could redirect index.php, and make sure all blog links to homepage point to .com/ and not .com/index.php
     
    just-4-teens, Nov 24, 2005 IP
  6. Jim_Westergren

    Jim_Westergren Notable Member

    Messages:
    1,882
    Likes Received:
    247
    Best Answers:
    0
    Trophy Points:
    235
    #6
    ok, I am going to do a 301 of all the URLs, It's only about 50 anyway.

    Thanks.
     
    Jim_Westergren, Nov 24, 2005 IP
  7. Jim_Westergren

    Jim_Westergren Notable Member

    Messages:
    1,882
    Likes Received:
    247
    Best Answers:
    0
    Trophy Points:
    235
    #7
    Ok, done and it works fine.
     
    Jim_Westergren, Nov 24, 2005 IP