Forums / Install & configuration / [3.4, PHP as CGI]: removing "/index.php?/" URL part
Yaroslav Markin
Friday 25 June 2004 4:18:43 am
I am running 3.4 with CGI patch, so all URL's look like:
/index.php?node1/node2/mynode
How do I remove "index.php?" from URLs? Running VHost mode.
Now i have default .htaccess:
<FilesMatch "."> order allow,deny deny from all </FilesMatch> <FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf)$"> order allow,deny allow from all </FilesMatch> RewriteEngine On RewriteRule !\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php DirectoryIndex index.php
Andres Attemann
Friday 13 August 2004 3:09:01 pm
Just tried today to play with Exponential 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 Exponential 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?/plain3. 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/plain5. 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
PSMake sure there IS ~/tmp dir or change script to use /tmp