M
M
Maksym Davydchuk2018-07-09 15:13:05
Nginx
Maksym Davydchuk, 2018-07-09 15:13:05

How to rewrite a rewrite rule from Apache to Nginx?

Hello, mainly used Apache, now faced with Nginx. How to rewrite this rule on Nginx?

<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} ^.*(pdf|epub)$
RewriteRule ^(.*)$ /wp-content/themes/divi-child/download.php?file=$1 [L]
</IfModule>

Thank you all for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-07-09
@maksym1991

Add to the server block.

rewrite ^/(.*(?:pdf|epub))$ /wp-content/themes/divi-child/download.php?file=$1;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question