"The following URL is not valid..." when trying to publish and InfoPath Template

I just received an error when trying to publish an InfoPath form. This same error occured in both InfoPath 2007 and InfoPath 2010. “The following URL is not valid …”.

After some messing around, I was able to get past this after adding a root site to my web application.

On my environment I had a site at http://myserver/sites/site1 however I did not have a root site setup at http://myserver. After adding a root site collection at http://myserver I can now successfully publish InfoPath templates to http://myserver/sites/site1. 

Hope this helps someone else out there!