|
If you're following this thread....
Basically what this came down to is using the PhpDock error handler for your 404 errors redirect everything back to your index.php. As Dmitri pointed out, almost everything you need is already in the $_SERVER array. All you need to do is pull from that. The trick with these URLs, especially when we use mod_rewrite and .htaccess with Apache, is that we remove index.php or we place a '/' directly after index.php. That creates a problem for any web server because it obscures the MIME type and the web server (PhpDock in this case) from discovering it. Apache has the same problem...that's why mod_rewrite and .htaccess exists. If PhpDock has trouble determining what document to load up, it puts the entire string after the host.tld:port into $_SERVER['ERROR_DOCUMENT']. So you can test for this array element. If it exists, you have a link without a MIME type or a real 404. If it doesn't exist, then you should load up your 'real' index file. So all you have to do is redirect every error page to your index.php file. Then, like Dmitri said (he get's all the credit here), trap that $_SERVER array element. I've provided Dmitri two full examples. One example is a straight example without any type of fancy framework footwork. The other example uses the CodeIgniter Framework to show how this technique can be used with frameworks as well. I should point out that I trimmed CodeIgniter down to the bear essentials to make this as small as possible. If you intend on using this, you should go get a full copy of CI. Hope this is helpful, Randy |
||||||||||||
|
|
Dmitri, You must have changed your e-mail address or the attachments we're rejected. My e-mail got bounced. I'll try to PM them to you. Randy |
||||||||||||||
|
|
Um.... Never mind. Is there anyway for me to get these files to you? |
||||||||||||||
|
|
hi randy,
could you mail me the examples because i can't seem to get it to work. Address is tim[removeme]@twixel.be grtz |
||||||||||||
|
|
On the way... |
||||||||||||||
|
|
thanks a lot!
i seem to get it to work by pointing the 404 to the index.php however, on some pages the webserver tries to send me (download dialog) the index.php file instead of parsing it any ideas? |
||||||||||||
|
Site Admin
|
you may want to check if your script outputs Content-Type header.
|
||||||||||||
_________________ The PHP IDE team |
|
I'm sure you've already verified this...but... This is likely because you have your URL constructed incorrectly or it is being constructed by ZF incorrectly. Your URL must be in the form: scheme :// hostname . tld / controller / method / var / var / var / etc ... (with no spaces) Please ensure ZF is not putting index.php and or /? and or ?/ and or ? back into the URL witout you realizing it. All these things will break your app just as the test page says in the CodeIgniter test says. |
||||||||||||||
|
|
I configured the ZF-Rewriter to skip the index.php . However the url's that PHPDock wants to load are of this type: http://localhost:8100/e:/phpdock/web/entry/add
My documentroot is set to the 'public' folder, all my other ZF folders (which should not be public) are in the PHPDock root dir. This is the HTTPClient section [HTTPClient] InitialUrl=http://localhost:${HTTPServer:Listen}/index.php BlockPopups=0 DefaultDocument=.\public\index.php ; |
||||||||||||
|
|
Found it, the code ran into a "catchable fatal error" which did nothing on Linux (because it was catched ) but gave problems with PHPDock. Fixed it and now it works
|
||||||||||||
|
|
Glad you got it sorted out. So we now have a ZF and CodeIgniter SEO friendly method of using PhpDock. I think that is awsome. For anyone following this thread, the reason, once again, is so I don't have to write two apps. This allows me to write one app one way and use SEO friendly URLs on the web and then move that app to the desktop using PhpDock with little modification. Thanks for the validating with ZF Tim. Regards, Randy |
||||||||||||||
|
SEO friendly URLs in the form of http://HOST/index.php/yada/ |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by