Project

General

Profile

[UE] POST data mod_rewrite

Added by netstrike 22 days ago

Hi to all, i'm trying to use Codegniter with lighttpd.
Inside config file, i've inserted this rule:

url.rewrite-once = (
"^/(css|js|img)/(.*)$" => "/$1/$2",
"^/(.*)$" => "/index.php/$1"
)

Now, all GET data request (direct or through ajax) works well, but,
if i make a POST request the server return 404 error.
I do not understand why.

Thanks to all those who will kindly give me a hand.

Ettore

lighttpd.conf (2.46 KB) lighttpd.conf Config file
error.log (27.6 KB) error.log Error log

Replies (5)

RE: POST data mod_rewrite - Added by gstrauss 22 days ago

Sorry, this is not a website for Codegniter support. The index.php is returning 404 to those requests. Please troubleshoot your PHP.

2022-09-14 15:24:32: (response.c.522) -- handling subrequest
2022-09-14 15:24:32: (response.c.524) Path         : /mnt/html/ci/public/index.php
2022-09-14 15:24:32: (response.c.526) URI          : /index.php
2022-09-14 15:24:32: (response.c.528) Pathinfo     : /login
2022-09-14 15:24:32: (gw_backend.c.2682) handling the request using fastcgi
2022-09-14 15:24:32: (response.c.164) fd:11 resp: HTTP/1.1 404 Not Found

RE: POST data mod_rewrite - Added by netstrike 22 days ago

Thanks for the answer, in fact it was a php script problem. How do you know from the log that the response was from the script and not from the server?
I was reading the log and weighed it on the server.
Can you please explain to me?

Thanks.

RE: POST data mod_rewrite - Added by gstrauss 22 days ago

Thanks for the answer, in fact it was a php script problem. How do you know from the log that the response was from the script and not from the server?
I was reading the log and weighed it on the server.
Can you please explain to me?

Step 1: assume an issue is a bug with you and your system and troubleshoot accordingly before assuming it is a bug in a very, very widely used web server (lighttpd).
Step 2: see Step 1
Step 3: see Step 1
Step 4: see Step 1

Since the lighttpd trace did not report any additional error messages from lighttpd, the response in the trace was generated from the backend after lighttpd reported "handling the request using fastcgi"
See Step 1.

RE: [UE] POST data mod_rewrite - Added by netstrike 22 days ago

I actually thought the rewrite rule I wrote was wrong (this is my first time using lighttpd), certainly not a server bug. I asked for a simple explanation on how to tell the difference on the log file ... But if you'd rather answer like that, thanks anyway.

RE: [UE] POST data mod_rewrite - Added by gstrauss 22 days ago

Since the lighttpd trace did not report any additional error messages from lighttpd, the response in the trace was generated from the backend after lighttpd reported "handling the request using fastcgi"

I asked for a simple explanation on how to tell the difference on the log file

And one was provided. See above.

I actually thought the rewrite rule I wrote was wrong

Where does the rewrite rule specify GET or POST? Hint: it does not. Poor assumption on your part. Why assumption? Because you did not test your assumption. You simply and wrongly assumed. Hence the response you got which included the words "and troubleshoot accordingly" since you did not test your assumption.

    (1-5/5)