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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:22:41+00:00 2026-06-12T18:22:41+00:00

Lets say I have a controller ‘standard’ with an action ‘main’. If I go

  • 0

Lets say I have a controller ‘standard’ with an action ‘main’.

If I go to http://www.myapp.com/standard/main it will invoke the main action in the standard controller.

Now if I want to change the URL I go into the routes.php and set sth like the following:

$route[‘welcome’] = “standard/main”;

Now I can visit http://www.myapp.com/welcome and it will invoke the same action.

However it is still possible to visit http://www.myapp.com/standard/main. I now have two routes which lead to the same controller action.

Is this the usual way or should I somehow disable the now unwanted http://www.myapp.com/standard/main route? If so, how would I do that?

Thanks in advance.

  • 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-12T18:22:43+00:00Added an answer on June 12, 2026 at 6:22 pm

    That is completely for you to decide the default behavior. If you decide to disable the original url, you can write something like

    $route['standard/main'] = 'standard/404';
    

    Or any custom location, it depends on your project and how you wish it should look like, for example you can ‘block’ any method from being accessed directly:

    $route['standard/(:any)'] = 'standard/404';
    

    But bear in mind, if you route like you did $route['welcome'] = "standard/main";, then you should always remember that the function $this->uri->segment(n) will show different values, for example if I will go to url yoursite.com/welcome/123, the value of $this->uri->segment(2) will be 123, but if I visit the original URL yoursite.com/standard/main/123, it’s value will change to main.

    Bear that in mind and decide for yourself!

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

Sidebar

Related Questions

Lets say I have the following Request URI: /controller/action/filter// When I call $this->_getParam('filter') in
Lets say i have a route like the following /{controller}/{action}/{id} Is it possible to
Using Rails v2.1, lets say you have an action for a controller that is
lets say I have two methods in my controller to support both json and
Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
Lets say I have a controller which provides search functions for a student: public
Lets say i have a Controller like this one : @RequestMapping(method=RequestMethod.GET, value=/error) public void
lets say I have a controller named Store. There is an index method: public
Lets say I have a controller class A which implements UIImagePickerControllerDelegate. within A ,
Lets say i have the following controller: // // GET: /Courses/Edit/5 public ActionResult Edit(int

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.