2012-07-03 61 views
0

您好,我想 「壓縮」 timthumb.php的網址,如:如何重新編寫timthumb.php圖片url?

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文件。

+0

讓我知道你爲什麼想這樣做。你爲什麼不使用WordPress的默認image_resize函數 – Gowri

+0

確切複製http://wordpress.stackexchange.com/questions/57322/how-to-short-url-in-timthumb-php – Gowri

回答

1

這是很長的,但也許你正在尋找這樣的東西?

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] 
+0

請看看這個http:// www.dollarshower.com/timthumb-and-wordpress-blog-performance/但我很迷惑 –

+0

@Nisha_Behance對不起,看看我的編輯,不知道爲什麼答案被分成2行。 –

+0

mine是wp-content/themes/bdtheme/thumb.php?src = wp-content/uploads/2011/09/Hindi2.jpg&w = 100&h = 100&zc = 1&q = 90所以 RewriteRule^wp/media /([^ \ [0-9] +) - ([0-9] +)\。(jpe?g | png | gif | bmp)$/wp- content/themes/bdtheme/thumb.php?src = http://%{HTTP_HOST} /wp/media/$1.$5&h=$2&w=$3&zc=$4 [L,R = 301] –