Como siempre he desarrollado la aplicacion en local sin problemas, pero a la hora de montarla en el servidor tengo el siguiente problema.
La home de la aplicacion carga perfectamente con el nombre del dominio www.dominio.com
Sin embargo los links internos de la aplicacion www.dominio.com/controller/action no cargan (Error 404)
Si a la direccion de inicio le añado index.php (www.dominio.com/index.php) tambien carga sin problemas y aqui los links internos si funcionan. (www.dominio.com/index.php/controller/action)
Estructura de directorios:
Código:
Contenido del .htaccess/ /application /application/controllers /application/views /application/models /library /public
Código:
Como comentario adicional decir que el hosting esta en 1and1.es y que dos dominios distintos apuntaban al mismo hosting.SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
es decir
www.dominio.es apuntaba a la raiz del hosting /
www.dominimo.com apuntaba a la raiz del hosting /
He modificado para que los dos apunten a /public
No se si tiene algo que ver.
Mi application.ini es:
Código:
[production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" resources.view[] = resources.db.adapter=mysqli resources.db.params.host=xxx resources.db.params.username=xxx resources.db.params.password=xxx resources.db.params.dbname=xxx [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1
Mi index.php
Código:
<?php // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // Define path to application directory defined('UPLOAD_PATH') || define('UPLOAD_PATH', realpath(dirname(__FILE__) . '/../filesystem')); defined('NOTICES_IMAGE_PATH') || define('NOTICES_IMAGE_PATH', realpath(dirname(__FILE__) . '/noticiasimg')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), get_include_path(), ))); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap() ->run();
Y mi Bootstrap
Código:
¿Alguna idea? <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initDoctype() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype('XHTML1_STRICT'); $traduccion = new Zend_Translate('array', realpath(dirname(__FILE__)).'/lang/es.php', 'es'); Zend_Form::setDefaultTranslator($traduccion); } protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Default_', 'basePath' => dirname(__FILE__), )); $acl=new Default_Model_ApplicationAcl(); $auth=Zend_Auth::getInstance(); Zend_Session::start(); $fc=Zend_Controller_Front::getInstance(); $fc->registerPlugin(new Default_Plugin_AccessCheck($acl,$auth)); return $autoloader; } }