I am a small newb with mod_rewrite. I am attempting to adjust my dynamic url for Search engine optimization reasons to redirect to some more recent plus much more Search engine optimization friendly version.

Here's my old structure:

RewriteEngine on
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ page.php?cat=$1&title=$2&subid=$3&id=$4

I have to have it to 301 for this new structure.

/ cat / title / subid / genericname_ id /

Thanks ahead of time for that help.

I believe this will get it done:

RewriteRule ^(.*)/(.*)/(.*)/(?!post_)(.*)/$ http://domain.com/$1/$2/$3/post_$4 [R=301,L]

RewriteRule ^(.*)/(.*)/(.*)/post_(.*)/$ page.php?cat=$1&title=$2&subid=$3&id=$4

This answer covers both redirecting Web addresses within the old format towards the new format and spinning Web addresses within the new format for your page.php with parameters. You need to have the ability to replace your present rule with these two.