Laravel .htaccess 404十月CMS插件中webp转换错误
在10月份使用第三方插件(“ResponsiveImages”)时遇到困难。该插件将图像转换为Laravel .htaccess 404十月CMS插件中webp转换错误,laravel,.htaccess,octobercms,Laravel,.htaccess,Octobercms,在10月份使用第三方插件(“ResponsiveImages”)时遇到困难。该插件将图像转换为webp。一些图像被转换,而另一些图像-否。对于其中一些图像,我得到了错误404代码。图像也不会显示在博客组件的后端 如果我尝试直接访问图像-指定了未指定输入文件错误系统日志为空 我已将开发者推荐的规则添加到.htaccess中,现在看起来如下所示: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c>
webp
。一些图像被转换,而另一些图像-否。对于其中一些图像,我得到了错误404
代码。图像也不会显示在博客组件的后端
如果我尝试直接访问图像-指定了未指定输入文件
错误<代码>系统日志为空
我已将开发者推荐的规则添加到.htaccess
中,现在看起来如下所示:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
##
## You may need to uncomment the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
##
RewriteBase /
##
## Uncomment following lines to force HTTPS.
##
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [L,R=301]
<IfModule mod_setenvif.c>
# Vary: Accept for all the requests to jpeg and png
SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image
</IfModule>
# If the Browser supports WebP images, and the .webp file exists, use it.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
RewriteCond %{REQUEST_FILENAME}.webp -f
RewriteRule ^/?(.*)$ $1.webp [NC,T=image/webp,END]
# If the Browser supports WebP images, and the .webp file does not exist, generate it.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
RewriteCond %{REQUEST_FILENAME}\.webp !-f
RewriteRule ^/?(.*)$ plugins/offline/responsiveimages/webp.php?path=$1 [NC,END]
<IfModule mod_headers.c>
Header append Vary Accept env=REQUEST_image
</IfModule>
<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !^/plugins/vdlp/phast/phast\.php*
RewriteCond %{REQUEST_FILENAME} !/.well-known/*
RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/.*
RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
RewriteCond %{REQUEST_FILENAME} !/storage/temp/public/.*
RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*
RewriteRule !^index.php index.php [L,NC]
##
## Block all PHP files, except index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !^/plugins/vdlp/phast/phast\.php*
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]
##
## Standard routes
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
您可以使用此插件将图像转换为webp 或者文件模型对象getThumb()的标准方法
这是一个很奇怪的问题。 首先,我使用了gitHub上的一个稍微过时的
.htaccess
。
然后,一旦创建了所有图像,我就返回到原始的.htaccess
。
现在一切正常
<div class="owl-item active" style="width: 264.8px;">
<div>
<div class="hero-item portfolio-item set-bg" data-setbg="https://www.website.com/storage/app/uploads/public/5ff/742/879/5ff7428794d80134665311.jpg" style="background-image: url("https://www.filmustudija.lt/storage/app/uploads/public/5ff/742/879/5ff7428794d80134665311.jpg"); width: 321px; height: 321px;">
<a href="https://www.website.com/post/post" class="hero-link">
<h2>Heading</h2>
</a>
</div>
</div>
</div>
{{ property.image | resize(500, false, { mode: 'crop', quality: '80', extension: 'webp' }) }}
{{ obModel.avatar.getThumb(500, false, { mode: 'crop', quality: '80', extension: 'webp' }) }}