【发布时间】:2018-08-06 09:00:34
【问题描述】:
现在我有一个类 ApiController 用于带有 json 响应的 web 服务。 我的 api 方法之一 getAvatars 必须返回一个头像列表,其中包含 uploads/images 文件夹中图像的公共 url,但是这个文件夹被 .htaccess 文件限制访问:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
# Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
如何在我的应用程序外部为我的所有图像创建一个链接,例如(在 localhost 中):“localhost:5000/uploads/images/avatar_1.png”?
【问题讨论】:
标签: php .htaccess frameworks