• Is there a setup option that would allow this to work on an Nginx server setup that does not have an htaccess file?

    From Pressable Managed WordPress Hosting Support
    “As Pressable uses an Nginx server infrastructure instead of an Apache one we don’t use .htaccess files. The .htaccess is a feature of Apache.”

Viewing 1 replies (of 1 total)
  • Plugin Author Takis Bouyouris

    (@nevma)

    Hello, there,

    Sorry for replying so late, but I did not get the notification email from the system!

    It is true that this plugin mainly relies on the Apache htaccess file to redirect image requests to its special (PHP) script, where they can be handled accordingly.

    However, there has been some discussion in these forums as to how it could be integrated to NginX. But these suggestions require some manual tweaking. You can find them here and here.

    They basically guide you into the way you should configure your website’s NginX configuration file in the same way you would do it to setup WordPress permalinks. For permalinks you are required to do this inside the “server” context of your “conf” file:

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    This is described in the Codex here.

    What you need to do now is add this “rewrite” line to your “location” directive:

    rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;

    So the whole thing becomes:

    location / {
        try_files $uri $uri/ /index.php?$args;
        rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    }

    This is not the only way to go in NginX. There other combinations of directives you could use as to where to put the “rewrite” directive, but this should be the decision of you server admin. But this is the general idea.

    Hope this helped!

    Cheers,
    Takis

Viewing 1 replies (of 1 total)
  • The topic ‘Doesn’t work with Pressable – no htaccess file nginx’ is closed to new replies.