Zend Framework routing to image folder without using apache or nginx
I wish to know how to开发者_StackOverflow社区 route to specific folder inside routes.ini,
what i mean or what i want is that i have upload folder with subfolders like 300x200 and images inside those subfolders - some-title-image.jpg
i want route like :
/image-some-title-image-1 to be image path and image (see there is no extension of file)
image - action of controller media some-title-image - name of file 1 - id of article
I know how to make this on apache and nginx but i dont want this because i want system to be easy to administrate.
Thanks
Keep images away from hitting PHP through either Apache/nginx. Will slow down the number of requests you can handle a lot.
If you want to handle it through routes.ini then you can use a regular expression based route type http://framework.zend.com/manual/en/zend.controller.router.html
Edit
The RegExp you would need is - image-[a-z]*. Put this with the example they have given in the docs. The matched string can be put in a variable using which you can find out which image to display.
Still would advise against this. Would kill the server.
精彩评论