Forum Moderators: phranque
My question,
Options +FollowSymLinks
RewriteEngine on
RewriteRule index-post_id-(.*)\.htm$ index.php?post_id=$1
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /subdir/subdir/index\.php\?topic_id=([0-9]+)\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/subdir/subdir/index-topic_id-%1.htm [R=301,L]
as you may have guessed, I am redirecting from dynamic urls.
the code above seems to work but it leaves a trailing ?topic_id=1234
behind the url. so the url looks like:
http://www.example.com/subdir/subdir/index-topic_id-1234.htm?topic_id=1234
Options +FollowSymLinks
RewriteEngine on
RewriteRule index-post_id-[b]([^.]+)[/b]\.htm$ index.php?post_id=$1
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /subdir/subdir/index\.php\?topic_id=([0-9]+)\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/subdir/subdir/index-topic_id-%1.h[b]tm? [[/b]R=301,L]
my url patterns are this:
domain.com/subdir/subdir/index.php?top_id=(always numbers here)
domain.com/subdir/subdir/index.php?post_id=(always numbers here)
domain.com/subdir/subdir/index.php?forum_id=(always numbers here)
domain.com/subdir/subdir/index.php?cat_id=(always numbers here)
after combing for hours, the code above in my original post is the best I could piece together.
again, thank you for your timely response, and your help. It is much appreciated.