1

Situation

Recently I started a photo gallery on my server — https://mailo.svetel.cz/photos.

This gallery is generated by gem (third-party plugin). All the photo assets are located in /photos. In HTML the image assets are referenced via relative path

Screenshot of non-functioning HTML

The strange part is, browser (Safari and Firefox) is loading it as if the path is absolute.

Pretty logically server responds with 404, because there is asset https://mailo.svetel.cz/photos/po_tydnu_venku/thumbs/DSC2433.jpg, but the browser is asking for https://mailo.svetel.cz/po_tydnu_venku/thumbs/DSC2433.jpg .

Screenshot of 404

Before uploading, I did test the page in same browsers and the same code works locally.

Questions

  1. Why does browser think I am giving him absolute path?
  2. Do I need to configure something special for relative addresses when using HTTPS?
  3. Do I need to configure some header in nginx to use relative addresses?

1 Answer 1

2

The root path for https://mailo.svetel.cz/photos is https://mailo.svetel.cz/

To make the browser see /photos as a folder, you need to add the directory separator at the end: https://mailo.svetel.cz/photos/

Sign up to request clarification or add additional context in comments.

2 Comments

Maybe I'll embarrass myself again, but it seems to me there is still something strange happening. When I click on the gallery locally, it goes to po_tydnu_venku/, but on server it goes to po_tydnu_venku. Any idea why?
Ah, ok it doesn't. The local server redirects to po_tydnu_venku/ automatically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.