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 7528287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:20:15+00:00 2026-05-30T04:20:15+00:00

I have one module (site) in my zend framework app. What I am trying

  • 0

I have one module (site) in my zend framework app. What I am trying to do is first to check if controller/action exists and if not then try to match the URL against some custom routes.

My code in _bootstrap.php is as follows:

$router = $this->frontController->getRouter();
$router->removeDefaultRoutes();

// catalog category product route
$route = new Zend_Controller_Router_Route(
        ':categoryIdent/:productIdent',
        array(
            'action'        => 'view',
            'controller'    => 'product',
            'module'        => 'site',
            'categoryIdent' => '',
            'productIdent' => ''
        ),
        array(
            'categoryIdent' => '[a-zA-Z-_0-9]+',
            'productIdent'  => '[a-zA-Z-_0-9]+'
        )
);

$router->addRoute('catalog_category_product', $route);


$router->addDefaultRoutes();

I know that the routes in Zend Framework are matched backwards. So I tried the following URLs.

  1. example.com/site/index/index -> OK (executing action/controller => index/index)
  2. example.com/bags/bag-7 -> OK (executing action/controller => product/view)
  3. example.com/index/index -> WRONG ( executing action/controller => product/view, but this should be a part from the default routes, which are defined at the end)

This is the problem and I don’t understand why the default controller/action route is not applied.

  • 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-30T04:20:16+00:00Added an answer on May 30, 2026 at 4:20 am

    Your third example matches the pattern of your catalog_category_product-route. That is why it is send to product/view.

    You could try to add requirements to :productIdent and/or :categoryIdent, so that index/index does not match these requirements.

    The reference manual explains how to set variable requirements.

    edit: I missed, that you already placed requirements. But index/index still does match :categoryIndent/:productIndent. You could use the following regex for :productIndent, assuming that it is always word – dash – number:

    '/^([a-z]+-[0-9]+)$/'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have to get static information from one 'module' to another. I'm trying to
Scenario 1: I have one wrapper Perl script which uses another Perl module and
I have 2 perl modules every module use the second one i.e Module1.pm use
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
Hi I have a Joomla site with a template that has 2 columns. One
On my Drupal site, I have made a Users page using the Views module,
In one of the apps of my Django site I require a third-party module/library.
I have a new installation of drupal 6.22 and one of the first things
First of all I am stumped. I have a search-module for a CMS that
I have a multisite drupal instalation. I have one module used in a specific

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.