I’m at my wits’ end… I’m trying to do something simple, yet I can’t understand what is going wrong…
I’m simply trying to take all requests to the domain, and route them to index.php
EDIT for clarity: index.php acts as a dispatcher for the request, as part of a framework.
I’ve got this working on my local machine without problems, but on the server (VPS Linux with Plesk) I’m having all sorts of problems…
EDIT for clarity: These rules are defined in the vhost.conf config file for the virtual host.
Here’s the mod_rewrite:
<IfModule rewrite_module> RewriteEngine On RewriteRule ^/.* /index.php </IfModule>
Here’s the apache error log when I attempt to go to “www.mydomain.com/home/index” (for example):
[debug] core.c(3072): [client xxx.xxx.xxx.xxx] r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/phppath/cgi_wrapper/home/index [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /phppath/cgi_wrapper/phppath/cgi_wrapper/home/index [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /phppath/cgi_wrapper/home/index [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r->uri = /home/index
As you can see from the trace, it seems to redirect the /home/index to /phppath/cgi_wrapper/ which then seems to get passed on again to /phppath/cgi_wrapper/phppath/cgi_wrapper/home/index, and so on until the maximum internal redirects is reached.
An HTTP 500 is sent to the browser.
Further EDIT – extra information. From what I can make out from the way Plesk scatters its files about, these are the only two lines which have an effect on the virtual host. I think it’s probably that Action statement… can I override it somehow in the vhost.conf?
in php-cgi.conf: ScriptAlias /phppath/ "/var/www/cgi-bin/cgi_wrapper/" Action php-script /phppath/cgi_wrapper in php.conf: AddHandler php5-script .php
Further EDIT: Found this within a dynamically generated conf file (at vhost level).
<Files ~ (.php)> SetHandler None AddHandler php-script .php Options +ExecCGI allow from all </Files>
Has anyone got any ideas as to what’s happening? I’ve been pulling my hair our for two days… Thanks in advance