I have a private image with this URL.


An image style is created for the above image on location


The problem is when I display the original image, it works fine. But when I display the image with style, the image is not displaying and in the console, I get 404.

When I try to access the original image through the browser, I can access the image. But when I try to access the image with style in the browser, I get the The requested page could not be found.

I can confirm the image is present in the specified location. But don't know what is the issue.

Can anyone tell what can be the issue?


I found the solution.

Actually, the problem is that the image style URLs need an ITOK at the end of the URL.

So for that, I used the buildUrl function from the image style.

$image_style_url = $image_style->buildUrl($original_image_uri);

Now this gives a URL like this


And now with that URL, I can access the image with an image style.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.