Page 1 of 1

Incorrect request uri when routing through index.php

PostPosted: March 25th, 2013, 3:42 am
by johnc
As is pretty common among php developers our site is routing requests through index.php. URIs like /what/ever/thing are routed to /index.php/what/ever/thing and we use the $_SERVER['REQUEST_URI'] variable to then route the request to a controller.

When running under phalanger on a fastcgi server our request uri is simply "/index.php" for each and every request.

I've spent a while isolating this issue, our rewrite rules are solid (they are in production, unmodified, without phalanger) and our other fastcgi hosted projects don't seem to suffer from any bugs that might be in mono (though I wouldn't rule this out).

Any help would be appreciated. Thanks.

Re: Incorrect request uri when routing through index.php

PostPosted: March 25th, 2013, 1:54 pm
by Jakub Misek
Hi,

Phalanger does not run under fastcgi, so I just would like to ensure there is everything configured well. Phalanger is ASP.NET application, $_SERVER['REQUEST_URI'] variable is set directly by web server (mostly IIS).

Thanks,

Re: Incorrect request uri when routing through index.php

PostPosted: March 25th, 2013, 2:43 pm
by johnc
Oh there's no way to have it work on fastcgi? Damn, Phalanger looks amazing and I was looking to get my wordpress sites running under it but all our servers are linux/lighttpd (we don't use apache).

Re: Incorrect request uri when routing through index.php

PostPosted: March 25th, 2013, 2:53 pm
by Jakub Misek
fastcgi isn't usable for .NET applications since they have slow startup and makes use of threads instead of processes.

Phalanger runs as ASP.NET application, so you just need something like aspnet_mono for your server. (enable aspnet thru mono on your server)

Re: Incorrect request uri when routing through index.php

PostPosted: March 25th, 2013, 2:59 pm
by johnc
Yes, we're using the mono fastcgi server to run asp.net apps. We've used it for a while and our other asp.net applications seem to be fine running under fastcgi.

To be clear, the fastcgi server comes with mono itself http://www.mono-project.com/FastCGI.

Re: Incorrect request uri when routing through index.php

PostPosted: March 25th, 2013, 6:54 pm
by johnc
Alright, I think I found what the problem is. The FastCGI host provided by mono is building an (incorrect) RawUrl property instead of honoring the REQUEST_URI parameter supplied by the webserver.

I'm going to write an update and submit a fork request to the XSP repo managed by mono but it may take a while to be accepted.

Re: Incorrect request uri when routing through index.php

PostPosted: March 26th, 2013, 10:23 am
by Jakub Misek
This seams to be the only solution ... if you post the work item id, we can try to speed it up.