Help with Mod Rewrite Rules

Discussion in 'Apache' started by grant.r.brown, Jul 27, 2011.

  1. #1
    Hi,

    I'm having trouble creating mod_rewrite rules for the follow redirect and was hoping someone could help. I need to forward the following structure to new destination:

    http://www.sitename.com/YYYYMMDD-the-title-slug/

    To:

    http://www.newdomain.com/site-name/YYYY/MM/DD/the-title-slug/

    Just a couple FYIs:

    I'm running WordPress.
    YYYY - is the year
    MM - month
    DD year

    Thanks
     
    grant.r.brown, Jul 27, 2011 IP
  2. grant.r.brown

    grant.r.brown Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Figured it out:


    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])-([^/]+)/ http://www.rantsports.com/new-york-islanders/$1/$2/$3/$4/ [R=301,L]
     
    grant.r.brown, Jul 27, 2011 IP