I am a real newbie. I am having a problem with ZF URLs.
Setup: Apache has an alias to the iris/html directory in my development
area. My directory structure for this application is -
iris/application/controllers
/models
/views/filters
/helpers
/scripts/error
/index
/user
/html/images
/scripts
/styles
/library
.htaccess file in iris/html reads:
RewriteEngine on
RewriteRule !\\.(js|ico|gif|jpg|png|css)$ index.php
index.php is in iris/html and reads:
<?php
/**
* My new Zend Framework project
*
* @author
* @version
*/
set_include_path('.' . PATH_SEPARATOR . './library' . PATH_SEPARATOR .
'./application/models/' . PATH_SEPARATOR . get_include_path());
require_once 'Zend/Controller/Front.php';
error_reporting( E_ALL | E_STRICT );
/*
* Register an autoload() callback. This is optional but very handy.
*/
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$appDir = dirname(dirname(__FILE__)) . '/application';
Zend_Registry::set('appdir', $appDir);
$config = new Zend_Config_Ini("$appDir/etc/config.ini",'main');
Zend_Registry::set('config', $config);
/*
* This application uses a database, and our config file contains some
* parameters to connect to the database. Once we create this database
* adapter, save it in the registry and also tell the table class where
* to find it.
*/
$db = Zend_Db::factory(
$config->database->adapter,
$config->database->params->toArray()
);
/*
* The database we're using has utf-8 characters, so encode them properly
*/
$db->query('SET NAMES utf8');
/*
* Save this database connection in a place where other classes can find it.
*/
Zend_Registry::set('defaultDb', $db);
Zend_Db_Table::setDefaultAdapter('defaultDb');
/**
* Setup controller
*/
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory("$appDir/controllers");
$controller->throwExceptions(true); // should be turned on in development
time
// run!
$controller->dispatch();
My problem is that to access the index page I have to type the full url -
http://localhost/iris/index.php
http://localhost/iris/ gives me a 400 Bad Request
Your browser sent a request that this server could not understand response.
Like wise from the login form
<form name="form1" method="post" action="/iris/user/login">
produces the same 400 response.
Has anyone got some ideas about what I can do to fix this.
--
View this message in context:
http://www.nabble.com/Problem-with-ZF-URL-tp14510775s16154p14510775.html
Sent from the Zend Framework mailing list archive at Nabble.com.