As an alternative you can do this in Apache
as well by using mod_rewrite
and looking at the HTTP_USER_AGENT
variable. More information about this can be found in the mod_rewrite documentation.
Something like this could work:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (WOW64|OtherMatch)
RewriteRule ^(/path/to/dl-packages)/win-32.msi $1/win-64.msi [R,L]
This is more to show the basic consept and you might want to fine tune the (WOW64|OtherMatch)
string that should match the 64bit clients, not sure if WOW64
will match all Windows 64 bit browsers. Also I am matching the URL
to the win-32.msi
package in my RewriteRule
that would be the default package, and if a 64bit client try to get it it will be redirected to the 64 bit version instead. Depending on your site, you might want to handle this differently.