I open this issue because I had the same issue on 6.x GR and now it is quite the same.
So, I have a multilingual website uses prefixes, multi-site configuration, image module.
The problem appears when image style file is not exists and needs to be generated.
When image requested, i.e. http://www.example.com/sites/example.com/files/styles/thumb/image.jpg
GR module redirects request with 301 to http://www.example.com/PREFIX/sites/example.com/files/styles/thumb/image...
where PREFIX is default language and set not empty, i.e 'en'.
When browser trying to open the following URL then receives 404 error:
http://www.example.com/PREFIX/sites/example.com/files/styles/thumb/image...
So, I'd like to let the module to generate an image from the URL such as:
http://www.example.com/sites/example.com/files/styles/thumb/image.jpg
My apologies if this issue already have a solution or a patch but I was not able to find a solution after a deep digging.
Thanks in advance!
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | image_styles_multilingual_site_language_prefix_not_found-2150483-8.patch | 1.27 KB | fjgarlin |
Comments
Comment #1
spanac commentedTry this:
in: /admin/config/system/globalredirect
enable: Language Path Checking
UPDATE: this will not work. Sorry.
Comment #2
irowboat commentedAnyone figured this out? My image urls are being rewritten.
Comment #3
fox_01 commentedI have switched to language subdomain path and this will also work with image urls
Comment #4
irowboat commentedYeah, dropping language from the url does the trick. Provided you have the option.
Comment #5
jeisses commentedThis is an issue for me as well, but I can't drop the language from the URL..
Is there an other way to get image styles to work with GR on a multi-language site?
----
Edit:
Never mind, it turned out I had an Nginx configuration issue, I don't have problems with this anymore
Comment #6
zviryatko commentedAlso meet this problem, if you have official drupal-nginx config, don't forget to change this rule:
to
location ~ .*/sites/.*/files/styles/ {Comment #7
sjerdoStill experiencing this issue while using a nginx-configuration.
Changed the category to Bug report, since this breaks image styles (picture module) when a prefix is set in a multilingual setup.
The Global redirect module should not redirect for these files. This allows for duplicate content (eg. file1 is accessible at /en/sites/default/files/file1 and /nl/sites/default/files/file1)
Comment #8
fjgarlin commentedI was facing this issue as well and could not find any option to bypass the default language fallback for files. I created a patch that:
In my case this seemed to do the trick. I hope it helps.
Comment #9
rodrigoaguileraI found the patch on #8 not to work for me.
Why not just return and avoid any redirect for files?