I have a website where users can upload files, if they upload a file with a special character in the filename the filename will be encoded (for example: iordănescu.pdf will become iord%C4%83nescu.pdf)
This causes some problems to be able to open these files from a link on the website, I can't open the file with website.com/iordănescu.pdf
or website.com/iord%C4%83nescu.pdf
it only works when the encoded filename is encoded (so double encoded) like this: website.com/iord%25C4%2583nescu.pdf
This is my htaccess file in the folder where the files are uploaded to:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# remove language from url for file viewing
RewriteRule ^[A-Za-z]{2}/frontend/files/jobs/(.*)$ frontend/files/jobs/$1 [B,L,R=301]
This will redirect to: website.com/iordănescu.pdf
and will give the following error: The requested URL /frontend/files/jobs/iordănescu.pdf was not found on this server.