使用.htaccess为子文件夹中的网站调整图像大小

时间:2015-08-29 17:38:35

标签: php .htaccess

我正在关注本教程here 对于我而言,我的情况是针对一个未指向根目录的网站,而是指向一个子文件夹。

mydomain.com 指向一个看起来像

的路径
import feedparser
feed1_read = feedparser.parse(feed1) # doesn't hang
feed2_read = feedparser.parse(feed2) # hangs

图像存储为

/webroot/sites/sitename

我正在编辑位于 / webroot / sites / sitename 中的.htaccess文件,而不是webroot。

以下是我的.htaccess文件的内容

subdomain.mydomain.com/img/uploads/filename.jpg

你可以想象,这不起作用。有什么帮助吗?

注意:我已将缓存文件夹和 image.php 文件放在 / webroot / sites / sitename

1 个答案:

答案 0 :(得分:0)

根据您的评论,请尝试以下规则:

RewriteEngine on
RewriteBase /

RewriteRule ^small/(img/.+?\.(?:jpg|gif|png))$ $1 [L,NC]
相关问题