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 thi开发者_StackOverflows other thing"
My question is: "How possible is to find a production server without mod_rewrite?"
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.
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.
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.
精彩评论