Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images of entries not displaying #43

Closed
flevet opened this issue Oct 19, 2018 · 10 comments
Closed

Images of entries not displaying #43

flevet opened this issue Oct 19, 2018 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@flevet
Copy link
Member

flevet commented Oct 19, 2018

It seems that a lot of images of the entries of bii.eu are not shown anymore, like if the link to them is missing

@flevet flevet added the bug Something isn't working label Oct 19, 2018
@PerrineGilloteaux
Copy link
Member

ACTUALLY NONE of them is showing.
(only the one in your navigator cache...)

https://biii.eu/sites/default/files/ NOT accessible??
@miura it is likely related to the .htaccess?
It is actually the same with test.biii.eu.
We did not notice because images were in the cache.

@vcaldas vcaldas assigned vcaldas and miura and unassigned vcaldas Oct 19, 2018
@miura
Copy link
Member

miura commented Oct 19, 2018

partially fixed: partially means that images in biii.eu should now be appearing - but images in test.biii.eu and for the local copies are not. I think the priority for the production site is higher so I did like this. I will investigate what is wrong with redirections. -- and will report more details.

@miura
Copy link
Member

miura commented Oct 19, 2018

I cannot figure out a good way to create a condition applicable to both the production and the development environment. .htaccess is currently set differently in these two environments.

in test.biii.eu and in the local, following line redirects access to images to the production site.

RewriteRule ^(sites/default/files/.*\.(?:jpg|jpeg|JPG|png|PNG|gif|GIF|txt|csv|ico))$ https://biii.eu/$1 [L]

In the production site, this line is commented out to avoid the infinite loop of redirection. There should be a more clever way to set a condition but currently not working (failed this morning). Let's just for now go with this two different settings.

@vcaldas
Copy link
Member

vcaldas commented Oct 19, 2018

We can try adding the file to .gitignore. Then we can keep both copies separated.

@miura
Copy link
Member

miura commented Oct 19, 2018

yes. So I added web/.htaccess and .gitignore itself to .gitignore in the production site. Just for us to keep this in mind!

@miura miura closed this as completed Oct 19, 2018
@vcaldas
Copy link
Member

vcaldas commented Oct 19, 2018

I'm not sure that adding the .gitignore file in it is the right approach. Gitignore is a reserved file where we just add the files to be ignored. Otherwise, the updates will ignore the gitignore file. 😅

@miura
Copy link
Member

miura commented Oct 23, 2018

I understand your concern - but let's keep it as a temporal solution. production branch is in the downstream of other branches, and updates in web/.htaccess is only ignored in biii.eu htacess. Limitation is that when this file is updated in local or other branches for different reason, it will not be reflected in the production site. We just need not to forget this.

@miura
Copy link
Member

miura commented Oct 23, 2018

I let this issue opened again.

@miura miura reopened this Oct 23, 2018
@miura
Copy link
Member

miura commented Oct 23, 2018

here is the solution that works. I will PR this to dev later, and then to master and production.

# If the request is to the files directory. 
RewriteCond %{REQUEST_URI} ^/sites/default/files/(.*)$ 
# and the environment is not production 
RewriteCond %{HTTP_HOST} !^(www.)?example.com$ [NC] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
# Redirect the request to the production server. 
RewriteRule ^sites/default/files/(.*)$ http://example.com/sites/default/files/$1 [L]

based on the description from here

@miura
Copy link
Member

miura commented Jan 31, 2019

I pushed directly the changes to NEUBIAS/bise:dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants