The best solution we've found is to avoid trying to predict the URL, and create a custom URL redirect like http://mycompany.com/redirects/my-app-itunes
which you can update to redirect to the correct URL once you know it.
The exact string you must use is difficult to get right, especially when you have special characters, spaces etc. The rules might even change, or Apple could decide to change something. It's best to keep the URL under your control.
If you really want to go this route, see this documentation from Apple. It details exactly what you need to do to transform the app name into a short friendly iTunes URL:
- Remove all whitespace
- Convert all characters to lower-case
- Remove all copyright (©), trademark (™) and registered mark (®) symbols
- Replace ampersands ("&") with "and"
- Remove most punctuation (See Listing 2 for the set)
- Replace accented and other "decorated" characters (ü, å, etc.) with their elemental character (u, a, etc.)
- Leave all other characters as-is.
The application name should be the name as it appears in iTunes Connect's application list (non-localized). The best thing is to test this however.
Finally, from Apple:
These itunes.com URLs are provided as a convenience and are not
guaranteed to link to a particular application or company. Be sure to
test your URLs before using them in any marketing or other public
materials. If there are naming conflicts, continue using the standard
itunes.apple.com URLs, which contain a unique numerical identifier
within the URL.