I am trying to create a mod rewrite rule to correctly change an existing url structure that looks like this:
Old: somesite.com/scripts/data/database.cgi?ArticleID=29154&report=SingleArticle&file=Data
Into something that looks like this:
New: somesite.com/oldarticle/id29154.htm
All I need basically is to take the ArticleID and insert it into the new url structure. What I came up with isn't working, but I know I'm close:
RewriteEngine On
RewriteRule ^(.*)/database\.cgi\?ArticleID=([0-9]+)&report=SingleArticle&file=Data$ /oldarticle/id$1.htm [R=301,NC,L] # Permanent Move
I have tried many variations of the above, and am probably missing something in the initial string needing to be rewritten. Any help/suggestions would be greatly appreciated!