隐藏图像路径可能与htaccess的? [英] hide image path possible with htaccess?

查看:135
本文介绍了隐藏图像路径可能与htaccess的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的 http://blablablabla.com/Admin/img/blablabla映像路径。 但我不希望显示这条道路用户JPG我可以隐藏该URL以的htaccess

I got image path like that http://blablablabla.com/Admin/img/blablabla.jpg but i do not want to show this path user can i hide this URL with htaccess ?

例如:用户将看到这样的的http:// blablablabla.com/Info/img/blablabla.jpg 但我没有信息的文件夹,这是可能的吗?所以我不希望看到用户永远看不到我的图片路径是方法是有用与否我不知道告诉你的想法哪种方式最安全的躲我的路

For example : user will see path like that http://blablablabla.com/Info/img/blablabla.jpg but i have not Info folder this is possible ? so i do not want to see users never see my images paths is way is useful or not i'm not sure tell your ideas which way to most secure to hide my path

推荐答案

重写你的URL不会有所作为安全明智的。如果您拥有的唯一的安全是希望没有人会知道某个文件夹是否存在,那么你就没有安全性可言。

Rewriting your url will not make a difference security-wise. If the only security you have is hoping that no-one will ever know that a certain folder exists, then you have no security at all.

请求重写可以通过将下面的指令在你的网站上的WWW-根的.htaccess 文件来完成。

The requested rewrite can be done by placing the following directives in a .htaccess file in the www-root of your website.

RewriteEngine on
RewriteRule ^Info/img/([^/]+)$ Admin/img/$1 [L]

这是一个内部的重写,重写被请求的内部URL指向一个实际文件的URL。 $ 1 将替换第一个捕获组。请参阅文档了解更多信息。

This is an internal rewrite that rewrites the url that is requested to an internal url that points to an actual file. $1 is replaced by the first capture group. See the documentation for more information.

这篇关于隐藏图像路径可能与htaccess的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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