J
J
jamster2019-10-03 16:28:22
Nginx
jamster, 2019-10-03 16:28:22

How to set up redirect for wordpress pdf?

There is a regular wordpress site.
Accordingly, files in pdf format were uploaded through the media library along the standard path domain/wp-content/uploads/**/**/..pdf
You need to make a redirect depending on whether the user is logged in or not.
That is, if the user is not logged in, before redirecting to the login page, if logged in, then the file is available accordingly.
Hosted on nginx, so htaccess is not relevant.
THANK YOU VERY MUCH FOR THE ANSWER!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Dmitriev, 2019-10-03
@SignFinder

If you want to do something in WP - look for a plugin written by someone :-)
For example, you can try this one https://ru.wordpress.org/plugins/prevent-direct-access/

I
Igor Mavlikhanov, 2019-10-04
@Gori4ka

what would be a software solution, then you need not to give a direct link, generate a link through wordpress.
For example. in the theme you can do the following:
https://developer.wordpress.org/themes/template-fi...
https://wphierarchy.com/
add a template for pdf
and here you can already do what you need different checks and output pdf when need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question