Forum Moderators: phranque
^topic=([0-9]*) allows topic=<blank> and is probably not what you wanted. (.*) pattern is redundant.
^topic=([0-9]*) allows topic=<blank> and is probably not what you wanted.
The redirect works only if 'topic' is the first parameter, you should redirect for any position. sure? today redirect always
ok, thanks i need to think more.
Since you don't re-use the $1 backreference, the trailing (.*) pattern is redundant.
Add a question mark to the end of the target URL to CLEAR the query string.When add ? to the end line, add "topic=434543" to the url and not only the number.
RewriteEngine On
RewriteCond %{QUERY_STRING} ^topic=([0-9]*)
RewriteRule ^p/modules/smf/(.*) http://www.example.com/forums/topic%1.html [R=301,L]
http://www.example.com/p/modules/smf/index.php?topic=434534
to
http://www.example.com/forums/topic434534.html
If you want complete string then add ? over end of line
RewriteCond %{QUERY_STRING} ^topic=([0-9]*)
RewriteRule ^p/modules/smf/(.*) http://www.example.com/forums/%1? [R=301,L]
result:
http://www.example.com/forums/topic=233434 [R=301,L]
When add ? to the end line, add "topic=434543" to the url and not only the number.