如何重写 timthumb.php 图像 url? [英] How to re-write timthumb.php image url?

查看:44
本文介绍了如何重写 timthumb.php 图像 url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想压缩"timthumb.php 网址,例如:

Hi, I want to "compress" timthumb.php urls like:

http://mydomain.com/wp/themes/mymagazinetheme/timthumb.php?
src=http://mydomain.com/wp/media/sampleimage.jpg&h=400&w=580&zc=1

到:

http://mydomain.com/wp/media/sampleimage-400-580-1.jpg

这可能吗?请帮我看看这里是我的 thumb.php 文件.

Is it possible?, so please help me here is my thumb.php file.

推荐答案

这有点长,但也许您正在寻找这样的东西?

This is kind of long, but maybe you're looking for something like this?

RewriteRule ^wp/media/([^\-/]+)-([0-9]+)-([0-9]+)-([0-9]+)\.(jpe?g|png|gif|bmp)$ /wp/themes/mymagazinetheme/timthumb.php?src=http://%{HTTP_HOST}/wp/media/$1.$5&h=$2&w=$3&zc=$4 [L,R=301]

这篇关于如何重写 timthumb.php 图像 url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆