依赖 mod_rewrite 处理 SEF url 安全吗?
我已经阅读了字面上数百个教程、示例和更多代码,其中他们说:“如果你有 mod_rewrite 就这样做,如果你没有,那就做其他事情
”问题是:“如何找到没有 mod_rewrite 的生产服务器?”
I've read literaly hundred of tutorials, samples and many more code, where they say something like: "If you have mod_rewrite do it like this, if you don't then do this other thing"
My question is: "How possible is to find a production server without mod_rewrite?"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Apache 占所有 Web 服务器的比例不到 60%(来源:Netcraft Web 服务器调查)。这意味着至少 40% 的生产 Web 服务器没有 mod_rewrite(Apache 模块)。
Apache accounts for less than 60% of all web servers (source: Netcraft Web Server Survey). That means at least 40% of production web servers do not have mod_rewrite, an Apache module.
嗯,这完全取决于几件事。您是否处于共享通用 httpd.conf 文件的共享托管环境中?如果是这样,那么您没有 mod_rewrite 的可能性约为 50/50(根据我的经验)。
如果您处于自己的环境中 - 那么您拥有完全的控制权,因此您已准备就绪。
Well, that completely depends on a few things. Are you in a shared hosting environment where you're sharing a common httpd.conf file? If so, your chances of not having mod_rewrite are about 50/50 (from my experience).
If you're in your own environment - then you have total control so you're set.
使用 mod_rewrite 几乎是 SEF 的默认设置。 Apache 是所有 Web 服务器中使用最广泛的,通常我发现 mod_rewrite 是主机必须具备的标准功能。
如果您只使用 SEF 的一种方法,那么 mod_rewrite 毫无疑问应该是您的第一选择。
我认为您会发现,在大多数情况下,除了那些使用 IIS 的人之外,许多考虑使用 SEF 的人要么了解足够的知识,能够与主机讨论启用它的事宜,要么他们知道/雇用某人来执行此操作为他们排序的东西。
简而言之,我认为 mod_rewrite 非常标准且安全。
Using mod_rewrite is pretty much the default for SEF. Apache is the most widely used of all web servers, and generally I've found that mod_rewrite is quite a standard feature for hosts to have.
If you only do 1 method of SEF, then mod_rewrite should definutely be your first choice without question.
I think you will find that in most cases except those people that use IIS, a number of people looking into using SEF will either know enough to be able to talk to the host about getting it enabled, or they know/employ someone to do that sorta stuff for them.
In short, I think mod_rewrite is pretty standard and safe.