I'm hosting an internet site which has a www.domain.com/~user/ root address. Thus, root links in HTML for example /foo.bar aren't effective. They indicate www.domain.com/foo.bar rather than www.domain.com/~user/foo.bar. How could I write an .htaccess redirect rule that will rerwite all root links (/) into (/~user/)?

I've attempted the below, however i can't get results.

RewriteEngine On
RewriteRule ^/(.*)$ /~user/

Add <base href="http://www.domain.com/~user/" /> towards the mind of the HTML files, and take away that .htaccess stuff.