简体   繁体   中英

CakePHP Path Rewriting for controllers/actions and image URLs

I am using CakePHP. I have relative paths for images being generated, stuff like "img/1.jpg", etc.

I found with it sometimes when I call a certain action it redirects to a URL that ends with a /, sometimes it doesn't. So when it ends with something like: http://mysite.com/asdf/

then the image links break

when it goes to http://mysite.com/asdf

the images are fine. How do I standardize how that last "/" is used? Thanks!

For standardize You need to use HTML Helper for displaying images

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM