MOD 重写图像 URL 掩码
好的,我正在推出一个克隆的电子商务网站。我想为第二个站点的图像文件夹创建重写规则,以从第一个站点获取图像。
RewriteRule ^alice.gif$ www.rhinomart.com/images/h_home.gif
当我直接通过浏览器访问 alice.gif 时,它只是将我重定向到 rhinomart.com URL 和图像。如何防止重定向发生?当我访问 http://www.acnbiz.net/alice.gif 时,它应该获取alice.gif 直接来自 Rhinomart.com/images,而不是重定向。是否可以???
Okay so I am launching a cloned e-commerce site. I want to create a rewrite rule for the image folder for the second site to fetch images from the first site.
RewriteRule ^alice.gif$ www.rhinomart.com/images/h_home.gif
When I go to alice.gif directly through the browser it simply redirects me to the rhinomart.com URL and image. How do I prevent the redirect from occurring? When I go to http://www.acnbiz.net/alice.gif it should fetch alice.gif directly from Rhinomart.com/images and not redirect. is it possible???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想重写到外部站点但不重定向浏览器,那么您需要通过启用
mod_proxy
并使用[P]
标志来代理请求。If you want to rewrite to an external site but not redirect the browser then you will need to proxy the request by enabling
mod_proxy
and using the[P]
flag.