• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue .htaccess rule ignored if file exists

yehudigt

Basic Pleskian
I'm trying to add webp support to mys ite but it seems that if my not webp file exists the .htaccess rule is being ignored.

System is
  • ‪CentOS Linux 7.7.1908 (Core)‬
  • Plesk Onyx 17.8.11 Aggiorna #73
Using Nginx + apache / static files served through nginx but not images

This is my .htaccess part involved

RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp]

Both thes files exists:

But according to the previous rule I should always seee the webp if my browser supports it.

The strange thing is that if I browse a rewrited url like this one:

Which is this physical url
https://www.magazzinirossi.it/img/p/6/7/9/0/7/67907-large_default.jpg

I see the webp image.

If I try the physical file directly it serves me the jpg instead of the webp although there is the rule in .htaccess.

Can anyone explain me how can this happen?

Thanks
 
In the default configuration the .jpg file is served by Nginx, because it is static content. Such requests never reach Apache, for that reason an .htaccess rule that is meant to rewrite an URL ending on .jpg will never be executed.
 
Thank you Peter,
but as I said static files are served through nginx but not images: all the extensions related to images have been removed from the textarea, so they should be passed to apache (acccording to Plesk documentation). Screenshot attached. The only way to make it work is to unselect the intelligent processing of static files, which means that although those fiels should be passed to apache they are not. Maybe this is a Plesk bug...
 

Attachments

  • Schermata 2020-04-07 alle 15.52.27.png
    Schermata 2020-04-07 alle 15.52.27.png
    206.8 KB · Views: 7
Back
Top