.htaccess 正则表达式水印
我的网站上有一个自动水印脚本,.htaccess 文件使用此行将所有图像重定向到 watermark.php 文件,该文件为它们添加水印。我都在工作,除了 .htaccess 行还重定向 .js 之类的东西。所以现在我的 jQuery 不再工作了。这句话是这样的:
RewriteRule ^([^thumb].*\.[jJ].*)$ watermark.php?src=$1
我没有写它,我从某个地方复制它。我认为这与 jJ (对于 .js)有关,但是我如何更改它以仍然可以处理图像,但不能处理 JS 文件?
I have an auto-watermarking script on my website, and the .htaccess file uses this line to redirect all images to the watermark.php file, which watermarks them. That I all have working, except the .htaccess line also redirects things like .js. So now my jQuery doesn't work anymore. The line is this:
RewriteRule ^([^thumb].*\.[jJ].*)$ watermark.php?src=$1
I didn't write it, I copied it from somewhere. I think it has to do with the jJ (for .js), but how can I change that to still work with images, but not JS files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上述正则表达式匹配扩展名以 j 或 J 开头且文件名不完全由
t
的h
的u
的m
和b
。我认为这不完全是他们想要的。将重写任何扩展名:
The above regex matches any file whose extension begins with j or J, and whose filename doesn't consist entirely of
t
'sh
'su
'sm
's andb
's. Not exactly what they were going for I don't think.will rewrite anything with the extension: