[Solar-talk] Solar_Uri Apache 2 and Mod_Rewrite

Chris chris at dented-planet.net
Sat Apr 28 20:27:16 PDT 2007


Hello Readers,

I don't know if any of this info is actually helpful. but I thought  
I'd pass it along.

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

If you look at phpinfo() for an Apache 2 server, PATH_INFO will be  
missing.

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.

Chris
chris at dented-planet.net





More information about the solar-talk mailing list