I have a pdf file available on www.example.com/pdf/something. On httpd configuration I have a redirection to www.example1.com/pdf/something. In both cases pdf is downloading, but the redirection to example1 domain can be seen only in the network tab of developer tools, in the address bar the user still sees www.example.com/pdf/something although the pdf is downloaded from the www.example1.com.
Update: The configuration is something similar to this
<VirtualHost *:80 *:443>
RewriteEngine On
RewriteRule ^/$ https://www.example.com/en/ [R=301,L]
RewriteCond %{HTTP:someheader} !somevalue
RewriteRule ^(.*)$ https://www.example1.com/en$1 [END,R=301]
</VirtualHost>
The reson of this issue was the
content-disposition
respons header withattachment
value, changing it inline will force the browser to open the PDF in the browser and in that case the new location will be shown. THe othe possible soultion is returning a one line JS that forces the browser the PDF from another location. Long story short, the browser updates the address bar if there is a content to show, in my cas it was just downloading the PDF to the local storage.