Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After much tearing of hair, and gnashing of teeth, and three keyboards later... I've managed to find something that works. It's not pretty, but it does the job... If anyone can offer any improvements on this, please do - I'm all ears. Or eyes. As it were.</p> <p>So, I first noticed that recurring <code>/phppath/cgi_wrapper/home/index</code> problem in the Apache Log, which got me thinking: "Maybe I shouldn't be passing <code>/home/index</code> to the PHP CGI, but I should be passing <code>index.php</code>". So, I modified the Rewrite as follows:</p> <pre><code>&lt;IfModule rewrite_module&gt; RewriteEngine On RewriteLog /blah/blah/blah/rewrite_log RewriteLogLevel 5 RewriteRule ^.*$ /index.php [PT] &lt;/IfModule&gt; </code></pre> <p>I've simply added the PassThrough (PT) flag, which according to the documentation passes the rewrite result through to the handler.</p> <p>This got me the following apache <strong>error_log</strong>:</p> <pre><code>[debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r-&gt;uri = /index.php [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r-&gt;uri = /index.php [debug] core.c(3078): [client xxx.xxx.xxx.xxx] redirected from r-&gt;uri = /index.php </code></pre> <p>which I considered an improvement, but it still wasn't working.</p> <p>So then I went to my sparkly new <strong>rewrite_log</strong> to see if this could illuminate me. I saw:</p> <pre><code>xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390bbc88/initial] (2) rewrite '/' -&gt; '/index.php' xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390bbc88/initial] (2) forcing '/index.php' to get passed through to next API URI-to-filename handler xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390c2710/initial/redir#1] (2) init rewrite engine with requested uri /phppath/cgi_wrapper/index.php xxx.xxx.xxx.xxx - - [28/Aug/2012:15:38:05 +0400] [www.mydomain.com/sid#7f3c39001360][rid#7f3c390c2710/initial/redir#1] (3) applying pattern '^/(.*)$' to uri '/phppath/cgi_wrapper/index.php' </code></pre> <p>So, from this I deduced that I was having the same problem: <code>/phppath/cgi_wrapper/index.php</code> was now being passed into the rewrite engine again to be rewritten, and this was coming out with <code>/index.php</code> again, which was being passed back in, and etc. etc.</p> <p>So I added a condition. (This is the bit which seems ugly to me; I'm sure there's a better way):</p> <pre><code>&lt;IfModule rewrite_module&gt; RewriteEngine On RewriteLog /blah/blah/blah/rewrite_log RewriteLogLevel 5 RewriteCond ${REQUEST_URI} !^/phppath RewriteRule ^.*$ /index.php [PT] &lt;/IfModule&gt; </code></pre> <p>That RewriteCond is basically saying: Apply the following rule if the request does NOT begin with <code>/phppath</code>.</p> <p>And that's it. Now it's working; all requests are being handled by index.php, as required. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload