影响子文件夹网站的自适应图像
Adaptive images affecting subfolder websites
这是我的文件夹结构 -
在根文件夹中,我还有一个 .htaccess 和一个 adaptive-images.php 文件。 htaccess 告诉 'base' 级网站使用自适应图像以较低分辨率为较低分辨率的屏幕提供其图像。
但是,'another website' 文件夹中的站点现在不显示图像。这是有问题的网站 http://rrrepo.co/ - and if you try and open one of the images in a new tab you see this - 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>
如果您根本不需要自适应图像,您可以删除(或在规则前添加 #)。
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
这是我的文件夹结构 -
在根文件夹中,我还有一个 .htaccess 和一个 adaptive-images.php 文件。 htaccess 告诉 'base' 级网站使用自适应图像以较低分辨率为较低分辨率的屏幕提供其图像。
但是,'another website' 文件夹中的站点现在不显示图像。这是有问题的网站 http://rrrepo.co/ - and if you try and open one of the images in a new tab you see this - 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>
如果您根本不需要自适应图像,您可以删除(或在规则前添加 #)。
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