[Solar-talk] Solar_Uri Apache 2 and Mod_Rewrite

Rodrigo Moraes rodrigo.moraes at gmail.com
Sun Apr 29 15:29:39 PDT 2007


On 4/29/07, Chris <chris at dented-planet.net> wrote:
> I was looking at Solar_Uri. In the method solar_uri::set(), $_SERVER
> ['PATH_INFO'] is used. However, PATH_INFO is not set by default in
> Apache 2 (or at least in a way PHP can use). See the section entitled
> "AcceptPathInfo Directive" at http://httpd.apache.org/docs/2.0/mod/
> core.html

Hey Chis,
Indeed (and I use Apache 2). I've looked for alternatives in the PHP
documentation, but couldn't figure out an easy replacement. Do you
have something in mind?

> Second, about determining the status of Mod_Rewrite in solar_uri::set
> (). If Mod_Rewrite is on, it will set these environmental variables:
> SCRIPT_URI and SCRIPT_URL. If it's not on, they won't be set. See the
> section entitled "Environment Variables" at http://httpd.apache.org/
> docs/1.3/mod/mod_rewrite.html
>
> The only caveat about this technique is that mod_rewrite MUST be
> turned on in httpd.conf for it to work. Turning it on via .htaccess
> won't set those variables.

Perhaps this is why Solar_Uri uses the config key? It seems that
there's no easy way to guess if Mod_Rewrite is on, or not in any
situation. Relying on a method that would work only if it is on in
httpd.conf seems to be a bad idea for me...

Let me know your thoughts.
rodrigo


More information about the solar-talk mailing list