Using REQUEST_URI instead of PATH_INFO to use Pretty URL for weird rental server

Permalink
I'm just going to share this with everyone.

I had to deal with this because one of the major Japanese hosting company does not support PATH_INFO or ORIG_PATH_INFO in their PHP CGI Mode.

They co-exist PHP module mode and PHP CGI mode.

You can use PATH_INFO in PHP module mode, but does not let you turn off Safe Mode.

If you use PHP CGI mode, you cannot use PATH_INFO at all...


So, when you use PHP CGI mode, you cannot use Pretty URL...

So my solution was...

================================
My Solution Was Completely Wrong...
So I have deleted this solution (5/21/2009)
================================


Perhaps, we should use REQUEST_URI instead of PATH_INFO?

since I've witnessed that some hosting does not allow PATH_INFO and ORIG_PATH_INFO but REQUEST_URI...

katz515
View Replies:
katz515 replied on at Permalink Reply
katz515
Sorry...

I just realized that my method above does't work after all.

It won't let you edit the page at all....

Here is the proper solutions

You need to edit /index.php
<?php  
if (isset($_GET["pathinfo"])){
   $_SERVER["PATH_INFO"] = $_GET["pathinfo"] ;
}
require('concrete/dispatcher.php');


And .htaccess to
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?pathinfo=$1 [L]


Sorry guys.
scalait replied on at Permalink Reply
scalait
I have the same problem on servers running with PHP as CGI.

Your solution works... but not 100%. All the GET Variables are not correctly transfered.

our index.php looks like this:

ATTENTION! To NOT use this code, it works but there is another solution, check the bug tracker:http://www.concrete5.org/developers/bugs/5-4-1-1/path_info-problem/...

<?php
if (isset($_GET["pathinfo"])){
   $_SERVER["PATH_INFO"] = $_GET["pathinfo"] ;
}
$si_url_query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
parse_str($si_url_query, $_GET);
require('concrete/dispatcher.php');
paulcarlisle replied on at Permalink Reply
I'm having a similar issue installing Concrete, it looks to me (after many hours of tracing) that AcceptPathInfo is not available in Apache 1.3.41... i understand it's only available in => Apache 2.0. I can't seem to find a workaround similar to the one you posted above...
martijnR replied on at Permalink Reply
Thanks. I had the same problem but your solutions for editing index.php (marcgeldon) and .htaccess (katz515) worked for me.
scalait replied on at Permalink Reply
scalait
ATTENTION! To NOT use this code any longer, it works but there is another solution, check the bug tracker:http://www.concrete5.org/developers/bugs/5-4-1-1/path_info-problem/...
AaronMark replied on at Permalink Reply
katz515, I changed my index.php and I can't seem to find any file called .htaccess. I'm a newb at this programming stuff. Where can I find .htaccess? Thanks
AaronMark replied on at Permalink Reply
katz515, I changed my index.php and I can't seem to find any file called .htaccess. I'm a newb at this programming stuff. Where can I find .htaccess? Thanks
AaronMark replied on at Permalink Reply
katz515, I changed my index.php and I can't seem to find any file called .htaccess. I'm a newb at this programming stuff. Where can I find .htaccess? Thanks
Kafoso replied on at Permalink Reply
If your server settings allow you to change the php.ini-settings on the fly, you may fix (hide) a lot of Concrete5 related problems by adding the line below in the top of the 'index.php' directly after "<?php".

ini_set('error_reporting','E_ALL & ~E_DEPRECATED');