php - htacess Redirect request for pdf to another domain with the pdf; Mask domain -


i lot of php have admit every time htaccess confused. can following? note in following examples names of pdfs appended url's generated dynamically.

user requests: abc.com/uploads/pdfs/worlds_most_informative.pdf.

the actual location of pdf at: xyz.com/uploads/pdfs/worlds_most_informative.pdf.

i need have when pdf opens in browser user still sees: abc.com/uploads/pdfs/worlds_most_informative.pdf in browser address bar.

i have tried in vain adapt of other answers, without success. appreciated.

as pointed out in comments, can follow instructions of this question , use mod_rewrite , mod_proxy together.

rewriterule ^uploads/pdfs/(.*)\.pdf$ hhttp://example.org/uploads/pdfs/$1.pdf [p] [p] 

this way doesn't matter if name of file dynamically generated, because regex uses matching groups.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -