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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:07:31+00:00 2026-06-11T18:07:31+00:00

I am using Cake, but how do I make the routing like: Router::connect(‘/’, array(‘controller’

  • 0

I am using Cake, but how do I make the routing like:

Router::connect('/', array('controller' => 'homes', 'action' => 'index'));

case insensitve?

For instance:

Router::connect
(
    '/:user', 
    array('controller' => 'teachers', 'action' => 'contentProfile', 1),
    array('user' => 'hellouser')
);

MY_URL.com/hellouser works fine but not MY_URL.com/HelloUser does NOT route correctly.

And I have tried /heelouser/i and still nothing.

  • 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-11T18:07:32+00:00Added an answer on June 11, 2026 at 6:07 pm

    As indicated in the docs, you can use regular expressions to restrict matching route elements. The regex snippet you are looking for is:

    '(?i:hellouser)' 
    

    Route definition

    Putting the docs and your specific regex together, here’s a route that will match the url /hellouser in a case insensitive manner:

    Router::connect(
        '/:user', 
        array('controller' => 'teachers', 'action' => 'contentProfile', 1),
        array('user' => '(?i:hellouser)')
    );
    

    The third argument is used to restrict the possible values of route elements – in this case to “hellouser” in a case insensitive manner.

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

Sidebar

Related Questions

Using cake 2.1.1. I'm trying to make a cron job to execute an action
I am using cake 1.3 and i had tried to implement favicon..But some strang
I know this is simple as cake but I've been using ASP.NET controls for
I am trying to make the login work... but when i register (using the
I've been using Cake PHP but I'm kinda lost, I mean, I've made the
i am using cake php and i need that use tableheader but i face
It seems like it should be a piece of cake but neither Google or
I am creating a form using Cake.In the form there is a $this->Form->button($i); element.
I must integrate some macros in a project which is using a cake-pattern. That
Is it possible to load a single plugin from outside the cake root using

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.