'Specify Image Size With .htaccess
I want to be able to add some code to my .htaccess file that allows me to generate differently sized images by adding "?w=100&h=100" after the URL. Does anyone know what the code is to accomplish this? I have asked this question before, but I wasn't clear enough. I hope this is more understandable.
Solution 1:[1]
That's not something that a .htaccess file on its own can achieve; it's just a configuration file for features built into the Apache web server. It's commonly used to manipulate the URLs requested, because that's one of the features of Apache - the "rewrite module". Manipulating images is not a feature of Apache, as can be seen by looking through the list of modules in the documentation.
To do what you're asking, you need some kind of program running on the server - PHP, Ruby, Python, etc - that will do the actual resizing, probably storing the results at different sizes somewhere so they don't have to be regenerated every time. For instance, in PHP you would probably use functions in the gd extension.
Once you've got the program working, you can use mod_rewrite to point pretty URLs at it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
