I created a Controller in my application called UserController and Created a bunch of Actions in them which are empty at the moment. I used zf create controll user
and zf create action new user
I created a virtual host 'aman_proj'
When I type in the url 'aman_proj/' It displays the index.php page in /public.
But when I type in 'aman_proj/user/new', It still displays the index.php file in /public.
Can anyone help me why this is happening. I am pasting my index.php code below, let me know if you need to see more code. My controller has action but they are all empty. I have their view in view/scripts/user/new.phtml
//public/index.php
<?php
echo "<b>This is Zend Home Page located in /public/index.php</b><br>";
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
echo "APPLICATION_PATH : ".APPLICATION_PATH."<br>";
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
echo "APPLICATION_ENV : ".APPLICATION_ENV."<br>";
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
echo "Paths : ".get_include_path()."<br>";
/** Zend_Application */
echo require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
Ensure you have the following in your .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
I can't see anything wrong with your index.php file, and if you aren't getting the error pages it sounds like the the requests aren't getting rewritten.