简体   繁体   English

SEF URL依靠mod_rewrite是否安全?

[英]Is it safe to rely on mod_rewrite for SEF urls?

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" 我已经阅读数百篇教程,示例和更多代码,其中的内容类似:“如果您有mod_rewrite,请这样做,否则请不要这样做”

My question is: "How possible is to find a production server without mod_rewrite?" 我的问题是:“如何找到没有mod_rewrite的生产服务器?”

Well, that completely depends on a few things. 嗯,这完全取决于一些事情。 Are you in a shared hosting environment where you're sharing a common httpd.conf file? 您是否在共享托管环境中共享一个常见的httpd.conf文件? If so, your chances of not having mod_rewrite are about 50/50 (from my experience). 如果是这样,你没有mod_rewrite的机会大约是50/50(根据我的经验)。

If you're in your own environment - then you have total control so you're set. 如果你在自己的环境中 - 那么你就可以完全掌控所以你已经设定好了。

Apache accounts for less than 60% of all web servers (source: Netcraft Web Server Survey ). Apache占所有Web服务器的不到60%(来源: Netcraft Web服务器调查 )。 That means at least 40% of production web servers do not have mod_rewrite, an Apache module. 这意味着至少有40%的生产Web服务器没有mod_rewrite(Apache模块)。

Using mod_rewrite is pretty much the default for SEF. SEF几乎默认使用mod_rewrite。 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. Apache是​​所有Web服务器中使用最广泛的服务器,通常我发现mod_rewrite是主机具有的相当标准的功能。

If you only do 1 method of SEF, then mod_rewrite should definutely be your first choice without question. 如果你只做一种SEF方法,那么mod_rewrite应该毫无疑问是你的第一选择。

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. 我想您会发现,在大多数情况下,除了那些使用IIS的人以外,许多正在考虑使用SEF的人要么知道足够多,就可以与主持人讨论启用它的问题,要么他们知道/雇用某人来这样做。为他们排序的东西。

In short, I think mod_rewrite is pretty standard and safe. 简而言之,我认为mod_rewrite非常标准且安全。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM