Hi,
In version 4.0 you need just to set the IIS to use custom 404 handler, it is described
here. You only need to set the IIS to use handler404 page from that description.
Then, when the file is imported, please check on the Properties tab -> URLs, if in the Extended properties section is the extension you want to use.
Now you can access the file using .aspx and e.g. .jpg extension if it is an image.
More about the URLs section can be found in this
article.
Best Regards,
Juraj Ondrus