Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-20 20:31:24

misleb
New Member
Registered: 2006-01-20
Posts: 2

Problem (and solution!) using lighttpd with Textpattern

Hi all,

I just thought I’d post a solution to a problem we were having using Textpattern as a 404 handler under lighttpd. We recently migrated from Apache and we were using the mod_rewrite redirection rules which lighttpd doesn’t support.

To get Textpattern to work with lighttpd, we set

<pre>
server.error-handler-404 = “/index.php”
</pre>

We already had clean URLs working, so everything seemed to be working OK until we noticed that some sections weren’t rendering properly. We narrowed it down to pages with a “partially messy” URL such as /research/?c=research. I learned that $_SERVER[‘QUERY_STRING’] is not set for 404 pages and hence, no $_GET superglobal. I had to figure out a way to set $_GET. So what I did was add this:

<pre> $query_array = explode(‘?’, $_SERVER[‘REQUEST_URI’]); if (isset($query_array1)) { parse_str($query_array1, $_GET); }
</pre>

to /index.php before textpattern();

Now everything seems to work fine.

HTH

-matthew

Last edited by misleb (2006-01-20 20:38:44)

Offline

#2 2006-01-20 21:15:46

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Problem (and solution!) using lighttpd with Textpattern

Can you confirm that this works with POST requests? i.e. posting comments on a clean article permlink page.


Alex

Offline

#3 2006-01-20 21:19:44

misleb
New Member
Registered: 2006-01-20
Posts: 2

Re: Problem (and solution!) using lighttpd with Textpattern

It would not work for POST requests. This workaround only deals with GET requests.

-matthew

Offline

Board footer

Powered by FluxBB