timthumb.php是一个调整大小/裁剪的PHP脚本,在成千上万的网站中使用,我在我的wordpress博客中使用它,我正面临一个问题。
出于安全原因,我使用了一个更改wordpress默认路径的插件,例如:
之前 mysite.com/wp-content/uploads/2013/03/example.jpg
之后
的 mysite.com/images/example.jpg
我的问题:
如果您尝试直接访问example.jpg,它可以正常工作,但是使用timthumb则不然
mysite.com/images/example.jpg
即使文件实际位于 ,您也可以看到图像mysite.com/wp-content/uploads/2013/03/example.jpg
但timthumb无法识别并输出上述错误
当前.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^images/(.*) /wp-content/uploads/$1 [QSA,L]
RewriteRule ^lib/(.*) /wp-content/themes/mytheme/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^/wp-content/themes/mytheme/$ lib/ [R,L]
RewriteRule ^/wp-content/uploads/$ images/ [R,L]
RewriteRule ^lib/$ /wp-content/themes/mytheme/ [L,NC]
RewriteRule ^images/$ /wp-content/uploads/ [L,NC]
</IfModule>
答案 0 :(得分:0)
timthumb寻找路径,你打开并查看编辑php吗?
我也必须在更改目录后自定义timthumb ...我会查找我的代码。
timthumb拉出实际路径,因为服务器端已经超出了。
.htaccess用于通过网络浏览器从外部提取图像。
您的文件实际位于/public_html/wp-content/uploads/yr/mo/xxxx.xxx
因此脚本正在尝试解码不存在的位置。
您可能能够(将图像文件夹软链接到上传文件夹服务器端)
这将允许脚本无需修改即可正常运行。