OK, well the code you posted above is correct, and should do exactly what you want to do.
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^url=(.+)$ [NC]
RewriteRule ^$ http://%1/? [R=301,L]
So I have to ask... How do you define "doesn't work"?
What does or does not happen when you click on one of your on-page links?
Have you tried "monitoring" the transaction using the "Live HTTP Headers" add-on for Firefox/Mozilla browsers?
Do you have any other rewriterules that work?
If not, are you getting a 500-Server error with a message in the server error log stating that FollowSymLinks or SymLinksIfOwnerMatch is not set?
If so, then add
Options +FollowSymLinks -MultiViews
ahead of the "RewriteEngine on" directive in the code above.
Sometimes a simple test is useful. You could add a temporary 'test' rule to see if mod_rewrite is working at all:
RewriteRule ^foo\.html$ http://www.google.com/ [R=301,L]
Then request "/foo.html" from your server, and you should land at Google.
Be sure to completely flush (delete) your browser cache before testing
any new server-side code.
I should also note that all code discussed so far is written to work in a .htaccess context or inside a <Directory> container in a server config file. If the code is located elsewhere, the RewriteRule pattern will need to have a leading slash -- as in "RewriteRule ^/$"
Jim