Felix
Felix

Reputation: 5619

specify a .htaccess rewrite rule to open a pdf file

I want a rewrite rule in my htaccess file that if someone calls

www.domain.de/test 

a specified PDF is opened

Is that possible?

Upvotes: 1

Views: 2617

Answers (1)

Abhishek Gurjar
Abhishek Gurjar

Reputation: 7476

Below rule will rewrite to the location of pdf, showing of pdf will depend upon your sethandler rule in apache config.

I am assuming root is the location.

RewriteEngine On
RewriteRule ^test$ /file.pdf [L]

Upvotes: 4

Related Questions