Moving Zend Framework site to new host - “An error occurred Page not found”


I'm new to ZF and having issues moving a currently live site to a new host. The new host is running on a temporary dev URL using the IP and username as the domain. When I attempt to navigate directly to the index.php page that (I think) runs the site, I get a 404. Is there an issue with the site not having an true domain yet? Is ZF setup to check the path/domain is was originally setup on and now it's not finding that domain?

The currently LIVE site is setup in a subdirectory called /share/. I'm able to access the current LIVE site via FTP, and there doesn't appear to be any htaccess redirect in the root to get you to the path where the index.php file appears to be located: /share/clients/public/index.php.

I've also migrated the database and found the application.ini and monster.ini files with the DB username/password, and I've updated them to the new DB. I'm assuming these still run on localhost.

Current Development URL is running on an IP/user path.


When I navigate to:, I get a 404 Error.

If I setup a redirect in the root to that same directory, I get the same result.

Any ideas on where the issue is? I'm getting stumped. <strong>THANKS in advance for any help and especially quick replies. This site needs to up SOON!</strong>

HTACCESS IN THE /clients/ directory:

AddType application/x-httpd-php53 .php SetEnv APPLICATION_ENV production RewriteEngine On RewriteRule ^\.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /clients/public/index.php [NC,L] RewriteCond %{REQUEST_URI} !^/clients/public/.*$ RewriteRule ^(.*)$ /clients/public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L] RewriteRule ^public/.*$ /clients/public/index.php [NC,L]

INDEX.PHP in the /public/ directory:

//This line changes the timeout. //Give it a value in seconds (3600 = 1 hour) set_time_limit(3600); //Set these amounts to whatever you need. ini_set("post_max_size","8192M"); ini_set("upload_max_filesize","8192M"); //Generally speaking, the memory_limit should be higher //than your post size. So make sure that’s right too. ini_set("memory_limit","8200M"); // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); // Define path to uploads directory defined('APPLICATION_UPLOADS_DIR') || define('APPLICATION_UPLOADS_DIR', realpath(dirname(__FILE__) . '/../files')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), //get_include_path(), )));

<strong>UPDATE:</strong> I've tinkered with the HTACCESS files (one in the root, one in the "clients" directory), and have now resulted in a "Page not found" error. I feel like I'm getting somewhere, but obviously not hitting on all cylinders yet.

An error occurred Page not found Exception information: Message: Invalid controller specified (~username) Stack trace: #0 /home3/username/public_html/share/clients/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /home3/username/public_html/share/clients/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() #2 /home3/username/public_html/share/clients/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #3 /home3/username/public_html/share/clients/public/index.php(47): Zend_Application->run() #4 {main} Request Parameters: array ( 'controller' => '~username', 'action' => 'index', 'module' => 'default', ) o;io;

<strong>UPDATE 2:</strong> After further tinkering and searching, the following has gotten me to a login page (for clients?), but still no home page.

Thanks to Artur Michalak in an answer found here <a href="https://stackoverflow.com/questions/11157134/invalid-controller-specified-zend-framework" rel="nofollow">Invalid controller specified() - Zend Framework</a>

When I added the following to my application.ini file, it got the site to resolve to a login page.

resources.frontController.baseUrl = "/[alias directory]"

<strong>UPDATE 3:</strong> I also copied the .htaccess found in the /clients directory to the root, and updated the paths to the COMPLETE path.

EXAMPLE: If the path originally was /clients/public/index.php, I changed it to /~username/share/clients/public/index.php. This is true both in the root and /clients directories.



OK, my situation involved moving a Zend Framework installation from one host to another. To complicate matters, this part of the website isn't the "front end", plus the primary domain is hosted in one place, the main website is hosted at another, and then there's my part hosted at a 3rd location.

In the end, what I was needing was getting all <strong><em>subdomain</em></strong> requests to point to my Zend install, and it turned out to be rather easy once all the parts were in place.

<ol><li>Setup a subdomain in my cPanel where Zend is installed. </li> <li>Setup the same subdomain and A-Record to point to the IP address of the hosting for my Zend install. </li> <li>Leave the htaccess rules in their original setup as they came over with the moved Zend framework (i.e. reverse all of the edits I made up above)</li> </ol>

That's it! ... The only difference is that I set the DirectoryIndex to point to the index file that resides in the subfolder, but otherwise everything works like a champ.

What a flippin headache. Hopefully this helps somebody else and saves you a lot of time.

Good luck!


  • AWS CDN create signed url for specific S3 object version
  • svnmerge croaks on mysterious conflict
  • The Favicon is not showing on my wordpress website especially on Chrome
  • How to use permission account id for accessing video in AWS S3?
  • LUA Programming ,ESP8266 NODEMCU Serial communication
  • Pass parameters in Spring data
  • How to use Stash as a Maven remote repository for a Gradle project?
  • Access Denied when try to use Web deploy
  • setDateTimeFormat adds an hour
  • When configuring a relational store join, can I do a one-to-many join from the ActivePivot store?
  • Long press in UiAutomation
  • 'QString' object does not support item assignment python
  • How to use GROUP BY after the Having clause Mysql
  • Redirect subfolder to root domain
  • How to paste custom field values from the AR Invoice and AP Bill details directly into GL Transactio
  • Error while accessing shared preferences of Android App's first run
  • Simple mod_rewrite problem
  • clean url using mod_rewirte
  • Apache RewriteRule .* index.php [NC,L] Not working
  • htaccess internal rewrite from subdomain to subdir path
  • Redirect using username in URL with .htaccess [closed]
  • Can a bootstrap carousel rotate through only some of the slides?
  • Redirect site with .htaccess but exclude two+ folders
  • How can I mimic this behavior in WPF?
  • mod rewrite subdomain to folder break paths to css and images
  • Remove two subdirectories from url with mod_rewrite
  • SilverStripe. How to redirect from www.domainName to domainName?
  • apache won't start
  • Nginx custom PHP error_pages with different header status codes and body contents
  • How can I .htaccess 301 redirect all pages/files (except for one) to new domain?
  • CodeIgniter and htaccess - Protect a specific controller and its methods via AuthType?
  • url rewrite not working .htaccess
  • Strip down any parameter from URL which is not whitelisted
  • Use htaccess to mask domain and folder name
  • Can't use ignoreSSLIssues in HttpBuilder version 0.7.1
  • Security Issue on Accessing Remote Image with dompdf
  • Connect to strongest access point (access point with the strongest signal) with the same SSID
  • htaccess settings for angularJS pushstate
  • https in htaccess and order of rules (using Expression Engine)
  • Redirect to trailng slash (htaccess)