Since you want to redirect with a 301 to a new (permanent) URL, you should use a RedirectRule
.
Assuming you have a single web site which is configured to respond to subdomain.site.org
and to subdomain2.site.org
, you will need a RewriteCond
in order to only redirect requests from the old subdomain.
RewriteCond %{SERVER_NAME} ^subdomain\.site\.org$
RedirectRule ^/dir1/dir2/dir3/page\.cfm\?pc=(\d+)$ http://subdomain2.site.org/details.aspx?id=$1 [I,R=301]
The RedirectRule
finally only executes if the old URL pattern is matched, and restitutes the query string value of pc
to the new URL.