If you want to use a browser sniffer, by all means use a server-side script rather than javascript.
You could really use almost any server side scripting (or even programming) language, although
PHP is the general choice for individuals like yourself.
You could find a canned script easily enough and shouldn't need a vast amount of
PHP knowledge to implement it safely, about half an hour of introductory study and then reconfiguring your pages for the "*.
php" suffix.
The only real problem you might have is server implementation. I mean, you
shouldn't have a problem on most hosts, but if you did, you'd either have to get help or forget it.
The upside is, once you have it implemented, it works like a dream. Cross-browser worries are a thing of the past.