|
|||
|
I've written a very simple CMS atop Zend Framework, and it functions as expected on my local setup (Ubuntu Gutsy's Apache and PHP5 packages).
However, when uploaded to Netfirms, URI routing ceases to function as expected. A few code examples to outline what I'm doing: relevant bootstrap file excerpt Code:
// set up & run the front controller
$front = Zend_Controller_Front::getInstance();
// set custom routing rules
// @todo: define via XML
$router = $front->getRouter();
$route = new Zend_Controller_Router_Route('/:category/:seoId/*', array('controller' => 'page', 'action' => 'view', 'category' => null, 'seoId' => null));
// @todo: use regex to verify that seoId is proper format
// @todo: figure out how to throw a 404
$router->addRoute('viewPage', $route);
$front->throwExceptions(true)
->setControllerDirectory('./application/controllers')
->dispatch();
Code:
function viewAction()
{
$content = new PageModel;
$page = $content->getPage($this->_request->getParam('category'), $this->_request->getParam('seoId'));
$this->view->title = $page->pageTitle;
$this->view->description = $page->pageDescription;
$this->view->content = $page->pageContent;
}
However, on Netfirms, both calls to getParam() return "index.php". I found a support ticket for CakePHP that might outline a similar problem, but I'm not sure (and, contradictory to what is stated in that ticket, Netfirms does support mod_rewrite). My phpinfo() on Netfirms may be of use for investigation as well, as I believe it may be an issue with funky environment variables -- I've previously had issues with other PHP apps due to Netfirms's PHP install giving funky values to various $_SERVER variables. Can anyone please guide me from here? |
|
|||
|
The problem was that for some reason or another, Netfirms's PHP install incorrectly reports the REQUEST_URI, giving it the value of SCRIPT_NAME.
Something of a workaround may be found on the following page: How do I create search engine safe URLs in Wordpress? .: Netfirms 24/7 Support P.S. If anyone is thinking of buying hosting from Netfirms, for goodness sake, don't do it. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|