0

I have this in the .htaccess file:

Redirect 301 /product-installer  https://download.testsite.com/installers/My%20Product%20v3.0.0.0.exe

It's working correctly of Firefox as when you click the URL Firefox correctly downloads the file as:

My Product v3.0.0.0.exe

However on IE/Edge it downloads and saves as:

My%20Product%20v3.0.0.0.exe

I'm wondering if I'm doing something wrong here or is IE/Edge just bugged?

  • And simply leaving the conversion of the spaces up to the client by enclosing the target URL with "'s? i.e. use Redirect 301 /product-installer "https://download.testsite.com/installers/My Product v3.0.0.0.exe" – HBruijn Sep 24 '18 at 15:31
  • Generally you should avoid using spaces in URLs. They are considered unsafe by the Network Working Group as they cause all kinds of problems, this being one of them. Notice for example that in the serverfault URL of your post the spaces are replaced by dashes? There is a reason for that. Though for this case you could use "" as @HBruijn suggested. – Broco Sep 24 '18 at 15:38
0

This is normal behaviour for IE/Edge. Some web browsers like Firefox, file download names have %20 replaced with a white-space. Other web browsers like IE/Edge, file download names a white-space is replaced with %20.

On the Save As windows users can rename %20 into white-space. Or do the same via the file browser.

https://superuser.com/a/604604/722608

Using white-space in URLs can work, but they render as %20. Hyphens and underscores are preferred word separators accessing resources via URL. Try to avoid white-space in file names if possible.

https://webtech.training.oregonstate.edu/faq/what-are-good-file-naming-conventions

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.