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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:52:30+00:00 2026-05-19T01:52:30+00:00

This allows me to get easyly dynamic input variables instead of putting a static

  • 0

This allows me to get easyly dynamic input variables instead of putting a static prefix like /en/etcetcetc, but the problem is all controllers are blocked. Everything goes to index/index.

Question: How can i tell this rule allow evertying as it is now, but do not track if it contains http://site.com/donotcatch/me and http://site.com/iamnotbelongstodynamic1/blabla

  protected  function _initRoutes()
  { 
     ...
      $dynamic1 = new Zend_Controller_Router_Route(
            '/:variable0/:variable1',
            array(
                'controller' => 'index',
                'action'     => 'index'),
                array(
                      'variable0' => '^[a-zA-Z0-9_]*$',
                      'variable1' => '^[a-zA-Z0-9_]*$',
                    )
            );

Follow up:

Normally, i always belive yes we can, so, we can do that like this where dynamic1 does not the inter-fare with my other static controllers:

  // http://site/yeswecan/blabla
  // variable0 = yeswecan
  // variable1 = blabla
  $dynamic1 = new Zend_Controller_Router_Route(
        '/:variable0/:variable1',
        array(
            'controller' => 'index',
            'action'     => 'index'),
            array(
                  'variable0' => '^[a-zA-Z]*$',
                  'variable1' => '^[a-z0-9_]*$',
                )
        );


  // http://site/ajax/whatever...
  // solves it
  $dynamic2 = new Zend_Controller_Router_Route(
        '/ajax/:variable0',
        array(
            'controller' => 'ajax',
            'action'     => ''
            ),
            array(
                  'variable0' => '^[a-zA-Z0-9_]*$',
                )
        );

  // http://site/order/whatever...
  // solves it
  $dynamic3 = new Zend_Controller_Router_Route(
        '/order/:variable0',
        array(
            'controller' => 'order',
            'action'     => ''),
            array(
                  'variable0' => '^[a-zA-Z0-9_]*$',
                )
        ); 

Note:

  • Still the controllers are getting failed for example
    http://site/ajax/whatever always goes to /ajax/index where i wanted to send it as /ajax/user-inserted-value

How can i fix the $dynamic2 and $dynamic3 by keeping $dynamic1 ??

  • 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-19T01:52:31+00:00Added an answer on May 19, 2026 at 1:52 am

    Hey, it now sounds as if you just want each (ajax) action to go to its own action. Is that what you mean? If so, I think you can just use this:

      $dynamic2 = new Zend_Controller_Router_Route(
            '/ajax/:action',
            array(
                'controller' => 'ajax'
                ),
                array(
                      'action' => '^[a-zA-Z0-9_]*$',
                    )
            );
    

    You could also add a more general one for the rest of the ajax calls that don’t match your regexp:

      $dynamic1_and_a_half = new Zend_Controller_Router_Route(
            '/ajax/:variable',
            array(
                'controller' => 'ajax',
                'action' => 'index'
                )
            );
    

    If this is not what you mean, could you post your controllers as well, and also where you want the /ajax/whatever call to go?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like this question ought to have been covered, but I can't seem
As most should know close() also closes any streams uses. This allows the follow
Surely there is some kind of abstraction that allows for this? This is essentially
ffdshow has this awesome little API for controlling playback of video files. It allows
In .Net, I found this great library, HtmlAgilityPack that allows you to easily parse
I've used boost serialization but this doesn't appear to allow me to generate xml
I am trying to create a bunch of dynamic helper methods like these: show_admin_sidebar
I have this open-source library that I'm having some trouble fixing a problem... This
ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the
This article describes a way, in C#, to allow the addition of arbitrary value

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.