Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4626932
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:29:34+00:00 2026-05-22T03:29:34+00:00

I have the following structure of my system: application/ configs/ application.ini router.php layouts/ modules/

  • 0

I have the following structure of my system:

application/
   configs/
     application.ini
     router.php
   layouts/
   modules/
      default/
        controllers/
        forms/
        models/
        views/
        Bootstrap.php
      test/
        controllers/
        forms/
        models/
        views/
        Bootstrap.php
    Bootstrap.php

routes.php file:

$useDefaultRoutes = false;

$routes['index'] = new Zend_Controller_Router_Route(
                       '', 
                       array('controller' => 'index',
                       'action' => 'index', 
                       'module' => 'default'));

Main Bootstrap.php file

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    public static function setRoutes(){

        $frontController = Zend_Controller_Front::getInstance(); 
        $router = $frontController->getRouter();

        $routes = array();


        if(file_exists('../application/configs/routes.php'))
        {

            require_once "configs/routes.php";

            foreach($routes as $routeName => $routeValue){
                $router->addRoute($routeName, $routeValue);
            }

            if($useDefaultRoutes == false)
            {
                $router->removeDefaultRoutes();
            }

        }

    }

    protected function _initFrontModules() {
        $this->bootstrap('frontController');
        $front = $this->getResource('frontController');     
        $this->setRoutes();
    }

}

Problem

When I type in browser http://address, then default module launches IndexController and
everything seems to be ok. But if I type http://address/test, then I get error – page not found. If I remove routes.php file, then it works. So what is the problem with my routing ?

Your help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:29:35+00:00Added an answer on May 22, 2026 at 3:29 am

    Try this new way of routing…

    Include this in your bootstrap.php

    protected function _initAutoloadModules()
    {
        $autoloader = new Zend_Application_Module_Autoloader(
            array(
                'namespace' => '',
                'basePath'  => APPLICATION_PATH . '/modules/default'
            ), 
            array(
                'namespace' => 'Admin',
                'basePath'  => APPLICATION_PATH . '/modules/test'
            )            
          );
        return $autoloader;
    }
    

    This is your application.ini

    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    resources.frontController.params.displayExceptions = 1
    includePaths.library = APPLICATION_PATH "/../library"
    appnamespace = "Default"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    resources.frontController.defaultModule = "default"
    resources.frontController.defaultController = "index"
    resources.frontController.defaultAction = "index"
    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
    resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
    resources.layout.layout = "layout"
    resources.modules = ""
    resources.view[] =
    resources.session.remember_me_seconds = 864000
    resources.session.use_only_cookies = on
    includePaths.models = APPLICATION_PATH "/models/"
    resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
    

    and in module/default/bootstrap.php add below given variable

    protected $_moduleName="default";
    

    and in module/test/bootstrap.php add below given variable

    protected $_moduleName="test";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file with the following structure: system.action.webMessage=An error has happened during web
I have the following structure public class MyClass : MyBaseClass<System.Int32> { } In a
I have a mercurial repository with the following directory structure: / /system /applications /applications/client1
I have following structure with example data: id season_id title 1 1 Intro 2
In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I have following object structure, deseralized from XML (WS): <ns2:Category> <ns2:CategoryId>800003</ns2:CategoryId> <ns2:CategoryName>Name1</ns2:CategoryName> <ns2:Categories> <ns2:Category>
I have the following structure: <div id=container> <div id=someid1 style=float:right></div> <div id=someid2 style=float:right></div> <div
I have the following structure, one outer div (#results) and about 20 divs with
I have the following structure and function that adds things to the structure: struct
We have the following structure: ReportsDatabase X Report Y Report Y uses several tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.