Absolutely perfect!
I set up a VirtualHost:
VirtualHost {
Hostname = domain1.com, domain2.com
WebsiteRoot = /srv/http/hiawatha/wwwRedirect
StartFile = index.php
ExecuteCGI = yes
}
/srv/hiawatha/wwwRedirect/index.php is that file with the www to non-www code commented out. It owrked like a charm!