htaccess Redirect - Help

Discussion in 'PHP' started by falarious, Jan 6, 2013.

  1. #1
    I have over 2000+ posts with the following URL structure

    site.com/ID/POST-TITLE

    I need to redirect each post to

    site.com/post.php?id=ID

    If someone could shed some light on this I will love you forever! :)
     
    falarious, Jan 6, 2013 IP
  2. MockA

    MockA Greenhorn

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    5
    #2
    Little rusty on my htaccess rewrite rules should be something like..

    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^(.*)/(.*)$ http://example.com/post.php?id=$1 [R=301,L]

    Usually people want to go from post.php?id= to /id lol
     
    MockA, Jan 6, 2013 IP