<rule name="WebP Rewrite" enabled="true" stopProcessing="false">
<match url="wp-content/uploads/(.*)\.(jpg|jpeg|png)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="wp-content/uploads-webpc/uploads/{R:1}.{R:2}.webp" />
</rule>
Windows IIS rewrite rule
Hi @sibermedya,
Thank you for your message.
Please tell me if your solution worked?
Best,
Mateusz
yes, Windows IIS rewrite rule worked.
Image loading mode: via .htaccess / Nginx (recommended)
only still alert message wp control panel
Server configuration error
Error codes: rewrites_cached
Thank you for confirming, @sibermedya! This is a completely different error. Did you understand the instructions in this error message?
plugin support linux but not full support Windows iis.
I have good news. I found the settings and code that work flawlessly under Windows Server and IIS.
Now work without any message or warning like Nginx
Image loading mode: via .htaccess / Nginx (recommended)
output formats: WebP
I can not test AVIF format (available in the PRO version)
Windows IIS rewrite rule in web.config file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Vary" value="Accept" />
<add name="Cache-Control" value="private" />
</customHeaders>
</httpProtocol>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlCustom="private" cacheControlMaxAge="1.00:00:00" />
</staticContent>
<rewrite>
<rules>
<rule name="Serve AVIF if supported" stopProcessing="true">
<match url="^wp-content/(.+)\.(jpg|jpeg|png|gif)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTP_ACCEPT}" pattern="image/avif" />
<add input="{APPL_PHYSICAL_PATH}wp-content\uploads-webpc\{R:1}.{R:2}.avif" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="wp-content/uploads-webpc/{R:1}.{R:2}.avif" />
</rule>
<rule name="Serve WebP if supported" stopProcessing="true">
<match url="^wp-content/(.+)\.(jpg|jpeg|png|gif)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true">
<add input="{HTTP_ACCEPT}" pattern="image/webp" />
<add input="{APPL_PHYSICAL_PATH}wp-content\uploads-webpc\{R:1}.{R:2}.webp" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="wp-content/uploads-webpc/{R:1}.{R:2}.webp" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
-
This reply was modified 6 months ago by
sibermedya.
-
This reply was modified 6 months ago by
sibermedya.
-
This reply was modified 6 months ago by
sibermedya.
-
This reply was modified 6 months ago by
sibermedya.
-
This reply was modified 6 months ago by
sibermedya.
Thank you very much for your commitment, @sibermedya. I appreciate you sharing the solution here. It will definitely be useful to others.