所以这是我的文件夹结构 -
在根文件夹中,我还有一个.htaccess和一个adaptive-images.php文件。 htaccess告诉基地'级别网站使用自适应图像以较低的分辨率为较低分辨率的屏幕提供图像。
然而,在另一个网站中的网站'文件夹现在不显示图像。这是有问题的网站http://rrrepo.co/ - 如果您尝试在新标签中打开其中一个图片,就会看到这一点 - http://rrrepo.co/img/A.png
它说它无法在其父文件夹中找到自适应图像文件。
我不想在这个网站上提供自适应图像。当基层网站使用它时,我不知道为什么它说找不到自适应图像文件。
基础级别htaccess是否影响文件夹中的所有其他站点?
任何人都知道如何解决?
由于
编辑:
根目录中的.htacess
# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php
# enable expirations
ExpiresActive On
ExpiresDefault "modification plus 3 weeks"
ExpiresByType image/gif "modification plus 3 week"
ExpiresByType image/png "modification plus 3 week"
ExpiresByType image/jpeg "modification plus 3 week"
ExpiresByType image/pjpeg "modification plus 3 week"
ExpiresByType text/javascript "modification plus 3 week"
ExpiresByType text/html "modification"
ExpiresByType text/css "modification"
ExpiresByType application/javascript "modification plus 3 week"
# compress text, HTML, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
<IfModule mod_rewrite.c>
# For security reasons, Option followsymlinks cannot be overridden.
# Options +FollowSymlinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
# Adaptive-Images -----------------------------------------------------------------------------------
# Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
# RewriteCond %{REQUEST_URI} !ignore-this-directory
# RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
RewriteCond %{REQUEST_URI} !assets
# don't apply the AI behaviour to images inside AI's cache folder:
RewriteCond %{REQUEST_URI} !ai-cache
# Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
# to adaptive-images.php so we can select appropriately sized versions
RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
# END Adaptive-Images -------------------------------------------------------------------------------
</IfModule>
答案 0 :(得分:1)
如果你根本不想要自适应图像,你可以删除(或在规则之前添加#)。
RewriteCond %{REQUEST_URI} !assets
RewriteCond %{REQUEST_URI} !ai-cache
RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
如果它仅适用于一个域,则可以在RewriteRule之前添加行:
RewriteCond %{HTTP_HOST} !^www\.exemple\.com$ [NC]
# your actual RewriteRule:
RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php