Is there any way to protect/rewrite images under uploads/ folder

  • Author
    Posts
  • #3090250

    unity100
    Member

    We have a plugin which protects certain images and serves them to the user if they are logged in and have the right permissions.

    To do this, we have to rewrite all the images to wordpress so our code can check the user, and then serve the image if the user is valid.

    The htaccess rule we have works splendidly for singular WordPress installs on hosts that use Apache. But it doesnt work for multisite hosts or hosts that use nginx.

    So it doesnt work at WordPress.com

    There are other plugins which protect uploads/ folder or directories under it, like Easy Digital Downloads. EDD has below tutorial for nginx hosts, and some specific hosts like wpengine.com

    https://docs.easydigitaldownloads.com/article/682-protected-download-files-on-nginx

    But these dont work at WordPress.com

    ……….

    So the question is:

    Is there any way we can make a site at WordPress.com rewrite all the images to our plugin internally? This doesnt need to be through a htaccess rule addition, it can be through a wordpress internal rewrite rule as well.

    Thanks in advance.

    The blog I need help with is patron-plugin-test.com.

    #3090410

    Hi unity100,

    I see you chatted with one of our Happiness Engineers about this and they provided the information you needed. You are welcome to start a new chat if there is anything else you would like to know:

    https://wordpress.com/help/contact/

    #3090461

    unity100
    Member

    Yes we did talk. It seems there isnt any way to add custom rewrite rules to redirect images to WordPress.

    I opened this topic thinking that there may be developers who had the same issue and found a custom solution.

The topic ‘Is there any way to protect/rewrite images under uploads/ folder’ is closed to new replies.