The secure url that handles checkout processing is different than my site url. I am sure this is common for many users. Would be nice if emailed download links were based on the site's base url, and not the url handling the request at the time.

Line 686 of uc_file.module reads:
$output .= l($user_file->filename, 'download/'. $user_file->fid .'/'. $user_file->file_key, array('absolute' => TRUE)) ."\n";

A suggested fix would be more like:
$output .= l($user_file->filename, '{site url token code}/download/'. $user_file->fid .'/'. $user_file->file_key, array('absolute' => TRUE)) ."\n";

Let me know thoughts.

Comments

torgospizza’s picture

Actually the problem here is the use of the l() function. That function automatically creates a link based on your site's base_url, including the domain name.

I suggest a new function be created that would allow the integration of CDNs and other 3rd-party services such as Amazon S3.

longwave’s picture

Status: Active » Closed (won't fix)

This can be done with custom_url_rewrite_outbound() in D6 and hook_url_outbound_alter() in D7, I think.