[3.4, PHP as CGI]: removing "/index.php?/" URL part

[3.4, PHP as CGI]: removing "/index.php?/" URL part

Friday 25 June 2004 4:18:43 am - 1 reply

Modified on Monday 28 June 2004 12:10:38 am by Yaroslav Markin

Author Message

Andres Attemann

Friday 13 August 2004 3:09:01 pm

Just tried today to play with ez publish 3.4.1 (version doesn't matter, really), PHP-CGI, NVH mode.
It is quite broken (search is not working, admin interface is not working, etc) - but i've got rid of the /index.php? part of the url without patching ezPublish sources :)
Procedure:
1. unpack/install in e.g. ~/www/ezp (I assume ~/www is your docroot)
as normal (on PHP-CGI system). Assume siteaccess is "plain"
2. Test it's working as domain.com/ezp/index.php?/plain
3. create following .htaccess in ~/www

Options All -Indexes ExecCGI
DirectoryIndex plain

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /index.cgi

4. Make sure there is NO file named ~/www/plain
5. Create ~/www/index.cgi

#!/bin/sh

cd ~/www/ezp
# Execute index.php, tidy output, strip /ezp/index.php? part, replace &eZSESSID*" with "
php index.php | tidy -q | sed "s/\/ezp\/index.php?//g;s/\&eZSESSID.*\"/\"/g" > ~/tmp/out.html

#Print headers
echo "Content-Type: text/html"
echo -n "Content-Length: "
stat ~/tmp/out.html | grep Size | awk '{ print $2 }'
echo ""
cat ~/tmp/out.html

6. Test it. Should work

PS
Make sure there IS ~/tmp dir or change script to use /tmp

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.