routing

CakePHP Routing, using a language prefix with a default prefix

I'm trying to create a routing prefix that would be default. http://localhost/heb/mycont would leave to the Hebrew page, while http://localhost/mycont would lead to the English page. Router::connect('/:language/mycont',array('controller'=>'contname','action'=>'index'),array('language'=>'[a-z]{0,3}')); This code allows me to use 0-3 ...

ASP.NET MVC Routing two GUIDs

I have an action taking two GUIDs: public class MyActionController : Controller { //... public ActionResult MoveToTab(Guid param1, Guid param2) { //... } } I would like the following URI to map to the action: /myaction/movetotab/1/2 ...with 1 corresponding to param1 and 2 to param2. What will the route look like, and ...

Trouble setting a default controller in MVC 2 RC Area

This should be simple, but alas... I've set up an Admin area within my MVC 2 project (single project areas). I've created a couple controllers and their respective view folders. In the AreaRegistration.RegisterArea method, I've specified that I want the default controller to be "Dashboard": public override void RegisterArea(AreaRegis...

ASP.NET MVC Links result in 404 Errors after Deployment

I have deployed an ASP.NET MVC application following the article How to: Deploy an ASP.NET MVC Application. The index page for the app pulls up correctly rendering images, loading JavaScript and CSS. Unfortunately, none of the links work. I thought this Stack Overflow question ASP.NET MVC deployment to IIS 5/6 with Virtual Directory woul...

Rails routing with requirements

Hello reader, with the following routes I try to achive the goal, that I can present static resources like terms of use, imprint and so on in different languages using different urls. I defined two example routes for my imprint like that: map.imprint ':lang/impressum', :controller => "statics", :action => "imprint", :requirements =...

Do the parameter names in ASP.NET MVC routes need to match those in their corresponding actions?

Do the parameter names in ASP.NET MVC routes need to match those in their corresponding actions, and if so, why? ...

MVC Routing problem

I am learning MVC and I need to understand why it doesn't work the way it should. Here is my routing : public static void RegisterRoutes(RouteCollection routes) { // Note: Change the URL to "{controller}.mvc/{action}/{id}" to enable // automatic support on IIS6 and IIS7 classic mode //http://localhos...

Redirect from one Area's action to a action in the "root"-area?

I use the latest version of ASP.Net MVC 2 RC. My question is, how do I redirect from one action that's in the "Blog"-area to the index-action in the home-controller that exists in the "root" of my application (no area)? I tried: return RedirectToAction("index", "home"); but this redirects to /Blog/home, where Blog is the name of my ...

Creating a Custom Rails Route

I am attempting to create a custom route in rails and am not sure if I am going about it in the right way. Firstly I have a RESTful resource for stashes that redirects to mystash as the controller: map.resources :stashes, :as => 'mystash' site.com/mystash goes to :controller => 'stashes', :action => 'show' Which is what I want. Now ...

Troubleshooting the addition of MVC to an ASP.NET WebForms application

I have an ASP.NET WebForms application that I'm trying to switch to MVC for new development. I'm generally following this tutorial plus Google and Stack Overflow. The setup has been "easy", but for some reason I can't seem to get the first MVC controller/view to appear. My first thought was that I had a problem with the routing, so I in...

How do i do gecoding and routing with OpenStreetMaps?

Because Google Maps API is not available in Israel (see here) I want to use OpenStreetMap. I'm confused by all the different ways to do geocoding, i.e. finding lat,long for an address. I'm also looking for the best way to do routing, i.e display a route between two locations, using OSM. I'm looking for JavaScript on the client and .Ne...

Routing depending on the subdomain

Please help me. I am quite new to kohana. How best to do so the controller was chosen based on the subdomain. For example: www.site.com -> Controller: siteroot. Method: run admin.site.com -> Controller: adminsite. Method: run moderator.site.com -> Controller: moderatorsite. Method: run director.site.com -> Controller: directorsite. Meth...

Reroute old content (.html/.php etc.) to Ruby on Rails

Hi together, I have switched to Ruby on Rails and my current problem is to reroute the old contents like XXX/dummy.html or XXX/dummy.php in RoR. What exactly is the best solution for isolated content (XXX/onlyinstance.html) content which has a internal structure like XXX/dummy1.html, XXX/dummy2.html http://guides.rubyonrails.org/...

Apache routing to ISS - SSL Port issue

How things works (or should): We have lots of clients apps set on IIS but Apache is the one that receives all conections (from port 443) and redirect them to the corresponding port on the IIS server. The problem is: our application is building the URLs based on the IIS port (final port) instead of Apache's (default 443) one, even tho t...

MVC Views returning 404 in IIS 7.5

I've been trying to figure out why my views are returning 404 in my staging environment, but not my development environment. Windows Server 2008 R2 IIS 7.5 MVC 2 Beta definitely installed. The first Route entry in my Global.asax is as follows: routes.MapRoute( "FindStore", "FindStore", new...

Manually instantiate a Controller instance from an arbitrary URL?

My skills are failing me, and I know I've seen the code around for this but I can't find it. What's the quickest way to take any arbitrary URL, run it through your asp.net mvc routing system, and come out with a reference to a controller instance on the other end? For example, code execution is inside some arbitrary controller method. ...

Generating URL through routing, using ID from a form field (ASP.NET MVC)

Say I want to display user details like so: http://www.mysite.com/user/1 I set a route up like so: routes.MapRoute("UserDetails", "user/"{id}", new { controller = "User", action = "Details" }); Then my controller: public ActionResult Details(int id) { User currentUser = _userRepository.GetUser(id); if (currentUser == nul...

Linking to location on page (#id) through ASP.NET MVC mechanisms?

My example: I have a View that presents a set of div tags that has content populated from the datamodel. [Multiple of these, with different location_id, naturally] <div> <a name="location_id"></a> Content </div> Now, I have a form [in its own view] that submits content that adds another record to the datamodel. Once the reco...

How to map a full domain to a subdomain-based Rails app account?

I'm developing a Rails app that by default sets up user accounts to a subdomain of their choosing. As an option, they will be able to map their own full domain to their account. So far this is how I have things set up. I am using subdomain-fu to power the routing: # routes.rb map.with_options :conditions => {:subdomain => true} do |app...

ASP.NET MVC Routing two parameters with static string in between

This is my routing: routes.MapRoute(null, "shelves/{id1}/products/{action}/{id2}", new { controller = "Products", action = "List", id1 = "", id2 = ""}); The thought is that you can do something like this: http://server/shelves/23/products/edit/14 And be able to edit product 14 on shelf 23. Checking it with Route Debugger, t...