Any wordpress / htaccess experts around ?

Discussion in 'WordPress' started by Rivmedia, Jul 17, 2011.

  1. #1
    Im looking to merge two wordpress blogs which im fine with , however i cant figure out how to write some rewrite rules for the htaccess to automatically redirect one URL structure to the other.

    The site thats being moved is has post urls like this :

    [url]http://www.blognumber1.com/this-is-a-post-page/[/url]
    PHP:
    and the blog its being merged into has URL's like :

    [url]http://www.blognumber2.com/category/this-is-a-post-page.html[/url]
    PHP:
    Does anyone have any idea the kind of rewrite rules i would need to put up so that all of blog1's pages are redirected correctly to blog2's URL structure ?
     
    Rivmedia, Jul 17, 2011 IP
  2. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Create a .htaccess in the root folder of
    www.blognumber1.com
    Code (markup):
    Or just edit, if there is one already existing.
    Add the following codes in it:
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.blognumber2.com/category/$1 [R=301,L] 
    
    PHP:
    Change the domain accordingly.
     
    тнє Sufi, Jul 18, 2011 IP
  3. Rivmedia

    Rivmedia Notable Member

    Messages:
    2,306
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    210
    #3
    Thanks for the reply,

    The "category" in the URL i think will be the problem because obviously after the merge the categories URL will be different and will not be a set category , I suppose i could setup a single category for the entire blog thats been merged instead of spreading the posts through the current sites categories.
     
    Rivmedia, Jul 18, 2011 IP
  4. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #4
    adbox, Jul 18, 2011 IP