Answer the question
In order to leave comments, you need to log in
How to generate image url on the fly?
Pictures will be generated on the server using GD+PHP. The path to the images will be like this
example.com/%random_numbers%/%image_name%.png - шаблон
example.com/123456789/alpha.png - пример
Answer the question
In order to leave comments, you need to log in
Found the answer
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} /uploads/.*?\.(jpg|jpeg|png|gif)$
RewriteRule ^(.*)$ auto-thumbs.php [L]
header('Content-Type: image/x-png');
Is it possible to make it so that when requesting such a urlRead about routing + mod_rewrite/try_files. At least understand how it works, ideally use the MVC approach, but in a simpler case, you can get by with knee-high options.
Is it possible to make it so that when such a url is requested, php generates an image and gives it immediately without savingRead about HTTP headers, then just return the content, nothing extraordinary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question