htaccess - 图像重定向问题
我想将图像请求重定向到父文件夹。所以我尝试这个:
RewriteEngine on
RewriteBase /app
RewriteCond %{REQUEST_URI} !/app/images/
RewriteRule ([^.]+\.(jpe?g|gif|bmp|png))$ ../images/$1 [R,L]
问题是,如果图像请求是...
http://domain.com/app/en/images/123.jpg
.....它会被重定向到:
http://domain.com/en/images/123.jpg
而不是所需的...
http://domain.com/app/images/123.jpg
I want to redirect my image requests to the parent folder. So I try this:
RewriteEngine on
RewriteBase /app
RewriteCond %{REQUEST_URI} !/app/images/
RewriteRule ([^.]+\.(jpe?g|gif|bmp|png))$ ../images/$1 [R,L]
The trouble is, if the image request is say...
http://domain.com/app/en/images/123.jpg
.....it gets redirected to:
http://domain.com/en/images/123.jpg
instead of the desired...
http://domain.com/app/images/123.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您需要的规则:
This is the rule you will need: