404 or rewrite

QuickPHP - PHP Tester and Debugger (Lightweight PHP Web Server).

Suggestions? Comments? Bugs? Post your feedback here.

Moderator: Laffin

404 or rewrite

Postby MaKARON on September 3rd, 2008, 3:54 am

Can you add handler for 404? ATM I can't do anything. I would rather use rewrite, but 404 will be enought.

Still waiting for next release :)
MaKARON
 
Posts: 15
Joined: August 30th, 2008, 12:04 am

Re: 404 or rewrite

Postby ZachSaw on September 3rd, 2008, 7:38 pm

Sure. I'll implement 404.
ZachSaw
Site Admin
 
Posts: 103
Joined: July 4th, 2008, 2:56 pm

Re: 404 or rewrite

Postby ZachSaw on September 4th, 2008, 11:29 pm

Just FYI, version 1.2 will be released soon. Putting it through final testing.
ZachSaw
Site Admin
 
Posts: 103
Joined: July 4th, 2008, 2:56 pm

Re: 404 or rewrite

Postby MaKARON on September 5th, 2008, 7:11 am

If you need mirror just mail me (server in Poland).
MaKARON
 
Posts: 15
Joined: August 30th, 2008, 12:04 am

Re: 404 or rewrite

Postby ZachSaw on September 5th, 2008, 2:07 pm

By handling 404, or "rewrite", do you mean getting the server to respond with a 404 with the doc is not found, or a custom handler (html template) for 404?

By "rewrite", do you mean redirect?

v1.2.0 will respond with 404 when the page is not found for php pages so that it's consistent with html pages. Before, it would return a soft404 (i.e. 200 OK with error message). It will NOT support redirection in place of 404, or a custom 404 response.

I may, or may not add those features in future releases. I'll only add them in if I could find a way to still keep QuickPHP lightweight. The last thing I want to do is reimplementing IIS / Apache and that's not the intent of QuickPHP.
ZachSaw
Site Admin
 
Posts: 103
Joined: July 4th, 2008, 2:56 pm

Re: 404 or rewrite

Postby MaKARON on September 5th, 2008, 4:52 pm

Some of php applications uses "nice url" - ie: /show_product_superextraproduct.html (redirected to /show.php?name=superextraproduct). I can't use my apllication if I need to rewrite all url's. If all 404 will be redirected to 'index.php' i will parse url and redirect to good script. I don't want to reimplement apache, but I want to publish my application for standalone application (with your sever - apache is too complicated for "normal user").
MaKARON
 
Posts: 15
Joined: August 30th, 2008, 12:04 am

Re: 404 or rewrite

Postby ZachSaw on September 5th, 2008, 6:21 pm

Ah, you mean URL rewrite.

That's a VERY specific functionality that is implemented in Apache via module and IIS via ISAPI (plugin).
What I can do is, I'll implement a plugin architecture of some sort in QuickPHP, exposing some its client request info such as URL path. Within the plugin, you can change the path to anything you wish - you could even implement the same functionality you get with mod_rewrite. Again, this will make QuickPHP almost like a clone of Apache. If you need all these features, it'll be worth your time setting up Apache.

I suppose I could expose the client request info entirely to the plugin, and you or anyone could write the plugin in PHP to manipulate the info before passing it back to QuickPHP. In which case, a QuickPHP.ini file would probably be required to get it to use the plugins and to specify in which order each plugin is executed.

How does that sound?
ZachSaw
Site Admin
 
Posts: 103
Joined: July 4th, 2008, 2:56 pm

Re: 404 or rewrite

Postby MaKARON on September 5th, 2008, 6:31 pm

I don't want server to get bigger and bigger. I don't want apache clone too.
Like I wrote some time ago - I need the simplest sever - exe, and nothing more (cfg or cli params).

URL rewriting is "optional" - 404.php in documenroot is enought. The only reason I want to rewrite is
"simplicyty" - and clear. I'd like /Products/action/show/id/12/full/1/ i don't like /index.php?module=products&action=show&id=12&full=1
They are "identical", but don't you like first url? All my aplication uses simpleurls.
MaKARON
 
Posts: 15
Joined: August 30th, 2008, 12:04 am

Re: 404 or rewrite

Postby ZachSaw on September 5th, 2008, 7:01 pm

Agreed. Let me know what you think of this idea.
This is definitely simple (using PHP script to map your HTML url to the corresponding PHP), keeps memory usage low, and still easy to deploy.

Sounds good?
ZachSaw
Site Admin
 
Posts: 103
Joined: July 4th, 2008, 2:56 pm

Re: 404 or rewrite

Postby MaKARON on September 5th, 2008, 7:16 pm

I agree with "functionality over speed" - It's server for testing and debugging - not productional.

About mod_rewrite vs script - mod_rewrite can handle "new" or "changed" url (ie: I've goot website with "old" urls - /asdf.php?asdf=1&qwer=2 - without any one line of php code I can add mod_rewrite to handle /asdf/asdf/1/qwer/2/ or even /asdf_asdf_1_qwer_2.html or both). But who cares?

We need simple server, not "the biggest and better".
MaKARON
 
Posts: 15
Joined: August 30th, 2008, 12:04 am

Next

Return to QuickPHP

Who is online

Users browsing this forum: No registered users and 2 guests

cron