webp icon indicating copy to clipboard operation
webp copied to clipboard

Rewrite Rule not working for Apache

Open SventB opened this issue 1 year ago • 0 comments

I am getting a 403 Forbidden with the Apache RewriteRule from README in my local DEV environment (it's Windows ;))

It's because of line

RewriteRule ^ %{REQUEST_FILENAME}\.webp [L,T=image/webp]

Apache log says:

[Wed Jan 31 19:13:19.301038 2024] [core:error] [pid 21260:tid 1220] (20023)The given path was above the root path: [client 127.0.0.1:54984] AH00127: Cannot map GET /fileadmin/_processed_/f/c/myfile_d239cc56df.png HTTP/1.1 to file

It's working with this rule:

RewriteRule ^(.*)$ $1\.webp [L,T=image/webp]

SventB avatar Jan 31 '24 18:01 SventB