【问题标题】:Webservice image public url网络服务图片公共网址
【发布时间】:2018-08-06 09:00:34
【问题描述】:

我已经用这个文件夹层次结构做了一个自定义的 php 框架:

现在我有一个类 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


    【解决方案1】:

    将此添加到您的 .htaccess 中

    选项+索引

    【讨论】:

      猜你喜欢
      • 2013-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多