Code Monkey home page Code Monkey logo

Comments (10)

PerrineGilloteaux avatar PerrineGilloteaux commented on August 17, 2024

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.

from bise.

miura avatar miura commented on August 17, 2024

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.

from bise.

miura avatar miura commented on August 17, 2024

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.

from bise.

vcaldas avatar vcaldas commented on August 17, 2024

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

from bise.

miura avatar miura commented on August 17, 2024

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

from bise.

vcaldas avatar vcaldas commented on August 17, 2024

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. 😅

from bise.

miura avatar miura commented on August 17, 2024

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.

from bise.

miura avatar miura commented on August 17, 2024

I let this issue opened again.

from bise.

miura avatar miura commented on August 17, 2024

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

from bise.

miura avatar miura commented on August 17, 2024

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

from bise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.