我有
中的图片/home/crawler/scrapers/images/website
例如
/home/crawler/scrapers/images/website/1/img-name.jpg
我的Apache root位于
/var/www/html
我在此文件夹中有.htaccess
,其中包含以下内容
RewriteEngine On
RewriteRule ^/images/(.*)$ /home/crawler/scrapers/images/$1 [R,L]
我的目标是如上所述显示images文件夹中的图像。
http://website.com/images/website/1/img-name.jpg >> /home/crawler/scrapers/images/website/1/img-name.jpg
目前我正在
Not Found
The requested URL /home/crawler/scrapers/images/website/1/img-name.jpg was not found on this server.
Apache/2.4.18 (Ubuntu) Server at IP Port 80
PS:我确认已启用hataccess。
答案 0 :(得分:3)
您可以使用Alias
directive。
在vhosts.conf
或httpd.conf
中添加以下代码,然后重新启动Apache。
Alias /images /home/crawler/scrapers/images
<Directory /home/crawler/scrapers/images>
Allow from all
</Directory>