Actually if your url requests a controller that does not exist, or a
controller that does exist but an action that does not exist you do
not get a 404 error because mod_rewrite sends everything to index.php.

So how do you handle this? Throwing an exception or giving a blank
page doesn't seem like a user friendly response when somebody enters
the wrong url into their browser.


Mark

On 1/19/07, Andrey Korolyov <[EMAIL PROTECTED]> wrote:
If you get  / - you have indexFile
If you get /test.html - you have 200 response or 404

Default controller like index file for web server.

2007/1/19, Mark Wright < [EMAIL PROTECTED]>:
> I don't understand why a default controller isn't being used. Here's my
code:
>
>
> $baseUrl = substr($_SERVER['PHP_SELF'], 0,
>                    strpos($_SERVER['PHP_SELF'], '/index.php'));
> $frontController = Zend_Controller_Front::getInstance();
> $frontController->setBaseUrl($baseUrl);
> $frontController->setControllerDirectory($path_to_root .
> 'application/controllers');
> $frontController->throwExceptions(true);
>
> $frontController->dispatch();
>
> If I go to / or /index it works fine. If I go to /aa it throws an
> exception because aaController.php doesn't exist. But I thought the
> default controller was index so that if there is no aa controller it
> would default to the index controller. What am I missing?
>
>
> Mark
>
> --
> Have fun or die trying - but try not to actually die.
>




--
Andrey Korolyov | WEB Developer

e | [EMAIL PROTECTED]


--
Have fun or die trying - but try not to actually die.

Reply via email to