It'd be a lot better (for you) if you'd make an attempt to code this yourself, and then post specific questions, because it can be quite dangerous to your search rankings to use
server configuration code that you do not understand and therefore cannot accurately describe, test, debug, and modify.
We can't provide a "free code-writing service" here, because our contributors are very few, and our requestors are many -- and global.
Therefore our purpose here -as described in our Forum Charter- is to educate, not just to "do it for you."
The basic form of an external redirect (if you're sure that's what you want, as opposed to an internal rewrite) depends on whether you use Apache's mod_rewrite or mod_alias. But in general, it would be
RewriteRule ^this\.nsf$ http://web.example.com/that.nsf [R=301,L]
-or-
RedirectMatch 301 ^this\.nsf$ http://web.example.com/that.nsf
But you want to match *any* URL-path part that precedes ".nsf", and you also want to "pass that through" to the new URL. This is called a "back-reference."
RewriteRule ^(.+)\.nsf$ http://web.example.com/$1.nsf [R=301,L]
-or-
RedirectMatch 301 ^(.+)\.nsf$ http://web.example.com/$1.nsf
Here, the $1 on the right side refers back to the requested URL-path-part string which matches the
first parenthesized sub-pattern on the left.
As you can see, both of these Apache directives support the use of regular expressions to match the requested URL-path-parts. However, only mod_rewrite provides the ability to examine other parameters of the client request, such as the requested hostname. This is implemented with mod_rewrite's RewriteCond directive.
So if "web.example.com" is hosted in the same virtual server as "www.example.com" and these two subdomains share filespace, and this code will be executed when either is requested, then you'll have to use mod_rewrite in order to check the requested subdomain so that only requests for "www" will get redirected. Otherwise, you'll end up with an 'infinite' redirection loop.
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.+)\.nsf$ http://web.example.com/$1.nsf [R=301,L]
To use mod_rewrite, one or two lines of "setup" code are required. You may or may not need (or even be allowed) to use the first line on your server, and the only way to find out is to test. Further, the first line may need additional changes, and it's impossible to know without knowledge of the current server configuration or testing. So, something like these two lines, or only the second of these two lines, must be placed above the mod_rewrite rule just described:
Options +FollowSymLinks
RewriteEngine on
Please refer to the resources cited in our Apache Forum Charter, and see the tutorials in our Apache Forum Library. Links to both of these are at the top of each page on this forum. Take this code apart (one character at a time, if necessary) and be very sure you understand how it works before trying to use it. If I made a single tiny mistake, or if you did not specify *exactly* what you actually need, then this code could take down your server immediately. Or worse, it could ruin your search engine rankings within a few days.
Jim