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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:30:37+00:00 2026-06-10T12:30:37+00:00

I am trying here to create url, like: /admin/login /moderator/login both the request would

  • 0

I am trying here to create url, like:

/admin/login
/moderator/login

both the request would be served by same controller & action made for login, i.e. /account/login/<type>

Currently, all I am able to make the following URL:

/login/admin

/login/moderator

My current config file looks like the following:

resources.router.routes.login.route = "login/:type"
resources.router.routes.login.defaults.controller = "account"
resources.router.routes.login.defaults.action = "login"

I can’t figure out, on how to put the type variable at the start of URL, I tried it but it gives server error.
edit

I got this done, but can’t understand why this didn’t work earlier:

resources.router.routes.login.route = ":type/login"
resources.router.routes.login.defaults.controller = "account"
resources.router.routes.login.defaults.action = "login"

edit

Is it possible to make this arrangement more flexible, so that:
/login => /admin/login

I am not looking for solution via .htaccess

  • 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-06-10T12:30:39+00:00Added an answer on June 10, 2026 at 12:30 pm

    Add the following to your Bootstrap.php

    function _initRoutes() {
        $front_controller = Zend_Controller_Front::getInstance();
        $router = $front_controller->getRouter();
    
        $router->addRoute('login', new Zend_Controller_Router_Route(
            '/:type/login', array('controller' => 'account', 'action' => 'login')
        ));
    }
    

    from your loginAction()
    use:

    $this->getRequest()->getParam('type');
    

    Simple?

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

Sidebar

Related Questions

I'm trying to create a url pattern that will behave like controller/action/id route in
I am trying to create a simple drawing game like DrawSomething. The problem here
I'm trying to create an installer-like application. Here is what its supposed to do:
hi i am trying to create a URL that looks like this: black/granite/worktops where
I am trying to create a url router in PHP, that works like django's.
I am trying to create this controller: def calculate # Do some calculations here
Here's my code I'm trying to get working to no avail: CREATE DEFINER=`auser`@`localhost` PROCEDURE
I am trying to create auto-vectorized code with clang-3.2 From the slides here -
I'm trying to create a web application project template for everyone to use here
i am trying to create a query on my simpleDB. here is the query:

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.