Forum Moderators: phranque
I need a redirect to forward requests for a soon to be out-of-date URL to the new module (this was a forum upgrade where the forum module name changed).
The old string would come in like this:
[site.com...]
I added the foo bar variables because this may be the tricky part. There will be several different variations on the full URL string (based on different functions in the forum). So a perfect solution would redirect all requests after $OldName and keep the rest in tact.
The rewrites would simply need to go to:
[site.com...]
In case anyone is wondering, I want to do this because there are numerous existing links to the old forum both in my forum and out on the net. I want to keep these links working.
Thanks for any help.
Jim
Here is the updated code that worked for me:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(.*)module=OldName(.*)
RewriteRule ^(.*)$ /$1?%1module=NewName%2 [R=301,L]