The original problem:
Redirecting [FONT=“Courier New”][COLOR=“Red”]http://www.old-domain.com/news.php?id=232[/COLOR][/FONT] to [FONT=“Courier New”][COLOR=“DeepSkyBlue”]http://www.new-domain.com/blog/unique-post-title-here/[/COLOR][/FONT]
I initially solved this by:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} id=232$
RewriteRule (.*) /blog/unique-post-title-here/? [L,R=301]
</IfModule>
…and then making a new condition and rule for each blog post redirect.
The new problem:
The solution above will target any URI with an ?id=232 (or whatever number) query string. So [FONT=“Courier New”][COLOR=“Red”]http://www.old-domain.com/[COLOR=“Black”][B]news[/B][/COLOR].php?id=232[/COLOR][/FONT] and [FONT=“Courier New”][COLOR=“Red”]http://www.old-domain.com/[COLOR=“Black”][B]staff[/B][/COLOR].php?id=232[/COLOR][/FONT] will redirect to the same place when they are obviously different pages.
How would you add the logic to filter out the URIs with specific text behind the query string?