anandkunal / ToroPHP

Toro is a PHP router for developing RESTful web applications and APIs.
http://toroweb.org
MIT License
1.17k stars 173 forks source link

Update documentation with FallbackResource. #72

Closed malkusch closed 10 years ago

malkusch commented 10 years ago

Apache encourages the use of FallbackResource instead of a rewrite rule.

martinbean commented 10 years ago

Hi Markus. Do you have link to a resource where Apache encourages the use of FallbackResource instead of a RewriteRule?

malkusch commented 10 years ago

http://httpd.apache.org/docs/trunk/rewrite/remapping.html#fallback-resource

As of version 2.2.16, you should use the FallbackResource directive for this

martinbean commented 10 years ago

Neat tip, but I’m not comfortable with lowering the barrier of entry for users of ToroPHP by providing documentation that excludes users of older versions of Apache. Thoughts, @anandkunal?

malkusch commented 10 years ago

This feature is 4 years old. There exists no maintained version which doesn't support that feature. Apache is not that kind of software you want to run a unmaintained version. Anyways… your decision.

martinbean commented 10 years ago

If that’s the case and Apache >= 2.2.16 is in widespread use, then happy to mention it in documentation.

As I say, neat feature and I’ll look to use it myself in any Apache-hosted PHP apps (I work a lot with nginx these days), so thanks for bringing it to my attention!

khromov commented 10 years ago

There exists a large userbase of older Apache installations - all CentOS 6 machines are running Apache/2.2.15

[root@s3 ~]# httpd -v
Server version: Apache/2.2.15 (Unix)

CentOS 6 and its commercial brother Red Hat Enterprise Linux are well-maintained and have over 30% market share amongst UNIX OS'es. http://w3techs.com/technologies/details/os-linux/all/all

Apache actually errors out with an Internal Server Error when you use the FallbackResource.

I vote to revert the documentation change, since I think a large portion of web hosts can't use this. (Certainly not any vanilla CentOS or Red Hat installations.)

martinbean commented 10 years ago

This was exactly my hesitancy for merging this pull request. I’ll revert back at my earliest convenience, unless someone gets there before me.

khromov commented 10 years ago

Thanks Martin.

I think the FallBack directive is actually excellent and elegant, and should be part of the documentation. But it should be alongside with the older, more supported method.

malkusch commented 10 years ago

CentOS 6 and its commercial brother Red Hat Enterprise Linux are well-maintained

Regarding that mentioned market share. I really hope "well-maintained" means they distribute a patched 2.2.15 version with those 2.2.x upstream patches: http://httpd.apache.org/security/vulnerabilities_22.html

I just found that one: http://w3techs.com/technologies/details/ws-apache/2.2/all It shows sadly that 2.2.15 is about the median of all used 2.2 version. So, yes I agree keep that RewriteRule. I'd suggest to mention that FallbackResource as well for people with a more recent apache.