Need Redirection Code

Discussion in 'PHP' started by mit, Sep 21, 2012.

  1. #1
    Hello Guys,

    I had a wordpress blog on the root folder but now have transferred it to the new directory / folder i.e. it was initially www.abc.com and now it is www.abc.com/abc-acb-abc/

    The help I needed it to redirect all previous blog posts (which was on the root) to the new /abc-acb-abc/ folder.

    As per my knowledge, it can be done through .htaccess but really don't know about the code needed to make it done.

    It will be a great help to me. I am open to discuss it to Skype, PM or email.

    Thanks in Advance.
     
    mit, Sep 21, 2012 IP
  2. Poppers

    Poppers Member

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    28
    #2
    I just setup a .htaccess generator the other day haha, you might find it useful: http://www.htaccessredirect.com

    The code though, is:

    
    //301 Redirect Entire Directory
    RedirectMatch 301 oldpath(.*) newpath/$1
    
    Code (markup):
     
    Poppers, Sep 21, 2012 IP
  3. extraspecial

    extraspecial Member

    Messages:
    788
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    45
    #3
    Well done dude :)

     
    extraspecial, Sep 21, 2012 IP
  4. Mispero

    Mispero Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Php Code would be so

     
    Mispero, Sep 21, 2012 IP
  5. jonasg

    jonasg Member

    Messages:
    61
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    43
    Digital Goods:
    1
    #5
    Yeah but I think he meant each individual blog post!
     
    jonasg, Sep 22, 2012 IP
  6. mit

    mit Well-Known Member

    Messages:
    1,278
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    180
    #6
    Yes you are right my friend, I am looking for redirection to all the posts instead of the homepage redirection to the new directory.
     
    mit, Sep 23, 2012 IP
  7. Poppers

    Poppers Member

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    28
    #7
    Have you got it working?
     
    Poppers, Sep 23, 2012 IP
  8. alexkboorman

    alexkboorman Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #8
    what web server are you using? It makes a difference in the approach
     
    alexkboorman, Sep 23, 2012 IP