删除从IMG查询字符串 [英] Delete Query Strings from IMG

查看:141
本文介绍了删除从IMG查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯,我已经从心理上这htaccess的重定向事辞职。我不知道是不是大多数问题我甚至可能或只是没有人知道。

Well, I've already mentally resigned from this htaccess redirection things. I don't know if most questions I have are not even possible or just nobody knows.

不过,现在我有一个简单的问题,或许,有人谁是用来做什么的Apache的重定向。

However, now I've a simple question, probably, for someone who is used to do those Apache redirects.

我只是想重定向

 skullbones.jpg&h=200&w=200&q=70&zc=1

一timthumb产生的IMG,它得到一个错误的传入连接,为:

a timthumb generated img, which gets a wrong incoming link, to:

 skullbones.jpg 

很多机器人试图访问这些文件的img没有timthumb SRC路径,因此基本URL +的IMG +的timthumb查询字符串在404结束了。

Many bots try to access those img files without the timthumb src path, hence the base URL + the img + the timthumb query strings ending up in 404s.

将是真棒,如果有人可以至少解决这种情况。

Would be awesome, if someone could solve at least this case.

推荐答案

这应该解决这个问题。

RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /(.*)\&(.*)\ HTTP
RewriteRule ^ /%2\? [R,L]

以上将改变 http://example.com/skullbones.jpg&h=200&w=200&q=70&zc=1 http://example.com/skullbones.jpg

RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /([0-9]{4})/([0-9]{2})/(.*)\&(.*)\ HTTP
RewriteRule ^ /%2\? [R,L]

这篇关于删除从IMG查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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