Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The code you write work perfectly for this
- http://example.com/images/200x180
- If user pass only width, I have to assume that it is squre like this
- http://example.com/images/200 means http://example.com/images/200x200
- And I try to modify your htaccess code
- # request URL is for images
- RewriteCond %{REQUEST_URI} ^/images/([^x]+)x([^/]+)/? [NC]
- # disable storage loops
- RewriteCond %{REQUEST_URI} !storage [NC]
- # check for file exists
- RewriteCond %{REQUEST_URI} -f
- RewriteRule .* /storage/%1/%1x%2.png [L][OR]
- RewriteRule .* /storage/%1/%1x%1.png [L]
- Is this correct?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement