# 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-ImagesRewriteEngine On RewriteBase / # Adaptive-Images rules here...
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(es|fr|en)/favicon.ico$ favicon.ico
# redirect all requests to /de/assets* and /nl/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(es|fr|en)/assets(.*)$ assets$2
# redirect all other requests to /de/* and /nl/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(es|fr|en)?/?(.*)$ index.php?cultureKey=$1&q=$2
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1
</IfModule>
# redirect all requests to /de/assets* and /nl/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(es|fr|en)/assets(.*)$ assets$2
# Adaptive rules go here...
Do your images also contain the language folder alias?Yes.
Eg: http://www.domain.tld/en/path/to/image.jpg
I'm no expert in rewrite rules, but if that is the case you might need to add your Adaptive images rules after this so they are rewritten to the assets folder:Nope, doesn't work.
# redirect all requests to /de/assets* and /nl/assets* to /assets* RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(es|fr|en)/assets(.*)$ assets$2 # Adaptive rules go here...
/* get all of the required data from the HTTP request */ $document_root = $_SERVER['DOCUMENT_ROOT']; $requested_uri = parse_url(urldecode($_SERVER['REQUEST_URI']), PHP_URL_PATH); $requested_file = basename($requested_uri); $source_file = $document_root.$requested_uri; $resolution = FALSE;
$source_file = str_replace("/en/", "/", $document_root.$requested_uri);