Zend Framework

get error when input index.php in url instead of input nothing or index

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Not an Issue
  • Affects Version/s: 0.7.0
  • Fix Version/s: None
  • Component/s: Zend_Controller
  • Labels:
    None

Description



Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (index.php)' in c:\zf-tutorial\library\Zend\Controller\Dispatcher.php:159 Stack trace: #0 c:\zf-tutorial\library\Zend\Controller\Front.php(726): Zend_Controller_Dispatcher->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 c:\zf-tutorial\index.php(55): Zend_Controller_Front->dispatch() #2 {main} thrown in c:\zf-tutorial\library\Zend\Controller\Dispatcher.php on line 159

Activity

Hide
Jason Qi added a comment -

I could solve this problem by add

// Remove the .php from REQUEST_URI
if ($pos = strpos($requestUri, '.')) { $requestUri = substr($requestUri, 0, $pos); }

after line 531

in \library\Zend\Controller\Request\Http.php

But I don't have a big picture, does anybody have a better solution or consider this is not a issue?

Show
Jason Qi added a comment - I could solve this problem by add // Remove the .php from REQUEST_URI if ($pos = strpos($requestUri, '.')) { $requestUri = substr($requestUri, 0, $pos); } after line 531 in \library\Zend\Controller\Request\Http.php But I don't have a big picture, does anybody have a better solution or consider this is not a issue?
Hide
Matthew Weier O'Phinney added a comment -

Not an issue, really. The ZF MVC is expecting pretty URLs – i.e., no 'index.php' in the URL. If you need it there, and it will be present in all paths in the site, use setBaseUrl() to add it to the request's matching mechanisms.

Show
Matthew Weier O'Phinney added a comment - Not an issue, really. The ZF MVC is expecting pretty URLs – i.e., no 'index.php' in the URL. If you need it there, and it will be present in all paths in the site, use setBaseUrl() to add it to the request's matching mechanisms.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: