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

  • Home
  • SEARCH
  • 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 9019899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:52:54+00:00 2026-06-16T04:52:54+00:00

I’m pretty new to CakePHP but not new in any sense to programming. Usually

  • 0

I’m pretty new to CakePHP but not new in any sense to programming. Usually I can figure things out pretty quickly. However I think I need a little help with this one. Looking over the CakePHP Cookbook it explains routes pretty clear. The only thing I’m getting hung up on is route aliases. Maybe I’m getting it wrong but my understanding a far as route aliases go is that it’s just that, an alias. Therefore the original route should exist as well. It doesn’t seem to really work that way.

I created a route for capturing everything with /merchants, creating an alias

Router::connect('/merchants/:action/*', array('controller' => 'users'));

It does what it supposed to do. If I go to /merchants/login, it’s really /users/login. If I go to /users/login, it redirects me to /merchants/login. I do have the Auth component set up in the AppController. If I take Auth out then the alias works as it should. So I’m thinking that Auth is the culprit. Am I trying to be a bit too clever? Is there a better way to do this? Separate logins with the same controller.

  • 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-16T04:52:54+00:00Added an answer on June 16, 2026 at 4:52 am

    This is certainly due to reverse routing. The route you configured makes Cake use /merchants/ instead of /users/ when a link is parsed.

    The login action is by default /users/login. So when Cake redirects a user to the login url, /users/ is replaced by /merchants/ in the login url as well.

    If you want to force a specific URL for the login that do not use /merchants/, you could declare a more specific route for it like this:

    Router::connect('/login',   array('controller' => 'users', 'action' => 'login'));
    Router::connect('/merchants/:action/*', array('controller' => 'users'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.