Forum Moderators: phranque
url=http://www.example.com/BHIA/R/documents/Newsletters/2007/Q1/Newsletter.html?jmid=734790095
Will this do the trick?
RewriteCond $1 ^Newsletters/
RewriteCond %{query_STRING} .
rewriterule (.*) http://www.example.com/BHIA/R/documents/$1? [R=301,L]
[edited by: jatar_k at 8:22 pm (utc) on Feb. 21, 2007]
[edit reason] examplified [/edit]
RewriteEngine On
# Inserted to handle newsletters
RewriteCond $1 ^Newsletters/
RewriteCond %{query_STRING} .
Rewriterule (.*) http://www.example.com/BHIA/R/documents/$1? [R=301,L]
# End of newsletter insert
RewriteRule ^ach/?$ /BHIA/R?f=/documents/ach.pdf
RewriteRule ^cfaphp.htm$ / [R=301,L]
RewriteCond %{HTTP_HOST} example2.com [NC]
RewriteRule ^$ /fbphp/
RewriteRule ^imc/?$ http://%{HTTP_HOST}/BHIA/Do?h=bhia.CMS.Main&db=P&c=/&RefererURL=imc
RewriteRule ^vm/?$ http://%{HTTP_HOST}/BHIA/Do?h=bhia.CMS.Main&db=P&c=/&RefererURL=vm
RewriteRule ^fpl/?$ /
#RewriteCond %{HTTP_HOST} ^www.example2.com$
#RewriteRule ^$ /example2.html
#important rewrites below...
#match root page request
#important rewrites below...
#match root page request
#RewriteRule ^$ /Do?h=bhia.CMS.Main&db=P&c=/
#RewriteRule ^(.{1,5})/([\w\d\.\/]+\.html)$ /Do?h=bhia.CMS.Main&db=P&MarketChannel=&1&c=/$2
RewriteRule ^$ http://%{HTTP_HOST}/BHIA/
[edited by: jdMorgan at 2:26 pm (utc) on Feb. 22, 2007]
[edit reason] Removed specifics per TOS. [/edit]
I hope this gives you the additional info your requested.
# Inserted to handle newsletters
RewriteCond %{QUERY_STRING} ^jmid=
RewriteRule ^/BHIA/R/Newsletters/(.*)$ http://www.example.com/BHIA/R/Newsletters/$1? [R=301,L]
# End of newsletter insert
Note that the "documents" path given in your first example has apparently changed to "Newsletters" and this code reflects that change.
Jim