Wordpress timthumb.php友好URL,带.htaccess

Wordpress timthumb.php友好URL,带.htaccess,wordpress,.htaccess,url-rewriting,friendly-url,timthumb,Wordpress,.htaccess,Url Rewriting,Friendly Url,Timthumb,php是一个调整大小/裁剪的php脚本,用于数千个网站,我在wordpress博客中使用它,我面临一个问题 出于安全原因,我使用一个插件更改wordpress默认路径,例如: 例子 在mysite.com/wp content/uploads/2013/03/example.jpg之前之后 mysite.com/images/example.jpg timthumb根本无法识别新路径,它似乎检索到了404错误,它无法找到图像 我的问题: 如果您尝试直接访问example.jpg,它会正常工作,

php是一个调整大小/裁剪的php脚本,用于数千个网站,我在wordpress博客中使用它,我面临一个问题

出于安全原因,我使用一个插件更改wordpress默认路径,例如:

例子 在mysite.com/wp content/uploads/2013/03/example.jpg之前
之后
mysite.com/images/example.jpg

timthumb根本无法识别新路径,它似乎检索到了404错误,它无法找到图像

我的问题:

如果您尝试直接访问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>

重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写规则^images/(.*)/wp content/uploads/$1[QSA,L]
重写规则^lib/(.*)/wp content/themes/mytheme/$1[QSA,L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
重写规则^/wp content/themes/mytheme/$lib/[R,L]
重写规则^/wp content/uploads/$images/[R,L]
重写规则^lib/$/wp content/themes/mytheme/[L,NC]
重写规则^images/$/wp content/uploads/[L,NC]

timthumb正在查找路径,您是否打开并查看了php的编辑

我不得不在更改目录后自定义timthumb。。。我将查找我的代码

timthumb提取实际路径,因为它超出了服务器端

.htaccess用于通过web浏览器从外部提取图像

您的文件实际位于/public\u html/wp content/uploads/yr/mo/xxxx.xxx

所以脚本试图解码一个不存在的位置

您可能能够ln(将images文件夹软链接到uploads文件夹服务器端)

这将允许脚本在不进行修改的情况下正常运行。

如果查看脚本(在客户端执行)。您在路径上下文中调用它,该上下文与文件的物理位置不匹配。在这种情况下,htaccess对您没有帮助。这是因为它是在服务器上执行的,而不是在客户端。