routing

C#3.5 MVC2 routing skip optional param

Here I have: routes.MapRoute( "test", // Route name "DataWarehouse/Distribution/{category}/{serialNo}", new { controller = "DataWarehouse", action = "Distribution", category= UrlParameter.Optional, serialNo = UrlParameter.Optional } ); Category and serialNo are both optional params. When ...

Rails3 routing: Resource with namespace

Hi! Is it possible to define a namespace parameter when defining my routes, like this: resource :account, :namespace => :account do resources :comments end So /account/comment calls Account::CommentsController instead of just CommentsController. Just as a note, the :namespace-option above does NOT seem to work. I can of course ...

ASP.NET MVC2 lowercase Routes in Visual Basic

I have found 4 or 5 examples of "lowercase routes" in C# however when I use the telerik code converter, I get a bunch of errors. Namely something to do with "extension methods can be defined only in modules." Does anyone have any good resources on how to map routes to lowercase in VB? EDIT: here is an example of some converted code t...

Is WCF RoutingService transactional?

Hello everyone, In WCF4 we a provided with a great feature - routing services. MSMQ4 supports remote transactional read. So now building simple publish-subscribe on WCF seems to be a piece of cake. But I get one doubt. Does the System.ServiceModel.Routing.RoutingService, which implements routing stuff for messages, work in a transaction...

Nested resources without controller names in url

I've got a very simple Rails 3 app with a User model run by Devise and a Notes model. Right now the url and routing looks like this: # url /users/MEMBERNAME/notes/TITLE-OF-NOTE # routing resources :users do resources :notes end But I would like the urls to look like this, how would the routing look like in this case? # url /MEMBER...

How can I prevent duplicate content when re-routing pages in CodeIgniter?

Say I have a controller, "Articles" but I want it to appear as a sub-folder (e.g. "blog/articles"), I can add a route like this: $route['blog/articles'] = 'articles'; $route['blog/articles/(:any)'] = 'articles/$1'; This works fine, the only problem now is that example.com/articles and example.com/blog/articles both use the Blog contro...

Unable to read cache file (symfony.routing.data.cache)

Hi, We are having some troubles when many people is visiting our site at the same time. We are using Symfony 1.2.7 + Memcached on Amazon Web Services. We have 2 instances running Apache with load balancing. Database is MySQL and it is running in a separate instance that stores de web files (the other instances are mounting these files u...

Why does a trailing %20 (valid data in this case) kill asp.net mvc routing

Take the following controller action public ActionResult NextBySURNAME(int id, string data) { //code to process the data and edit the id accoringly not written yet return RedirectToAction("Edit", new { id = id }); } if I call it with /Mycontroller/NextBySURNAME/12/Smith%20Simon then it works fine (in this...

ASP.NET MVC Routing - Pass inbound route value to outbound URLs automatically?

I have an ASP.NET MVC application with an Admin area that deals with administering Companies and their child entities, such as Users and Products. The default route associated with a child entity is defined as follows: "Admin/Company/{companyID}/{controller}/{id}/{action}" I would like to ensure that, everywhere in the Admin area, whe...

Controlled access and routing

I have a rails application and I want to manage access to the application in a controlled way. The client user would have access to only certain views in the application, whereas the admin can access any page. In future, I may also add some semi-admins who might have access to a subset of pages that were accessed by the admin. I already ...

Pass an & as Part of a Route Parameter

Unfortunately I need to accept a route parameter with an & in it. I have this route definition. The id parameter will sometimes have an & in it like this X&Y001. routes.MapRoute( "AffiliateEdit", "Admin/EditAffiliate/{*id}", new { controller = "UserAdministration", action = "EditAffiliate", i...

ASP.NET 4 Web forms Routing images

I'm using ASP.NET 4 Web forms routing, for example like this: routes.MapPageRoute("page-browse", "{Language}/{Label}", "~/Default.aspx") So the webadress could look like: http://localhost/mywebsite/eng/home In the root of my website I have a folder "Images". Image display works when I'm in the root of my website, e.g. by using http://l...

How do you implement "Site under maintenance" for Windows Azure Web Site?

Hi folks, In one of our ASP.NET Web site solutions I need to roll out an update that might take reasonable time. It spawns multiple Windows Azure Workers and projects and so simple Deployment Swap is ruled out. Essentially I'm just thinking about way to redirect all web requests to a "site is under maintenance" page for some time, give...

Rails: Nested Resource Content App Management Structure

I am new to rails, and working on an internal content management app. I have made a prototype, but feel that it is messy and there is a better way. I require the following: My current prototype uses the workflow (http://github.com/geekq/workflow) plugin to manage the state of both the project and topics. I have also looked into acts_as_...

C# URL Routing Issue

So I have an interesting problem here. I am using URL Routing to mask the URL but I want to take the spaces out. For example: /sanjuan/ but in the database it's San Juan. An error is thrown when I type it in because clearly theres a space in the DB. I don't want it conjoined in the DB though. How can I accomplish this. I just need som...

ASP.NET Routing - Ignore routes for files with specific extension, regardless of directory.

Say I want to remove any mapped routes for files with a certain file extension. RouteTable.Routes.Ignore("{root}.hello"); Works for any file that has the extension .hello in the root directory, however as soon as i go into any subfolders the 'ignore' rule isn't applied. Ive tried lots of different combinations, but can't seem to get...

Url routing errors in php in codeigniter

My login form on front page is displayed, but when it posts to other pages, the post does not happen. THe problem is that the url is like: http://sitename/users/action which is a 404 not found url. But when i hard code the path to controller, (that is, stop using base_url + "/users/action" and use base_url + "/system/application/controll...

Symfony: question about routing and slugging

In order to not show the ID's of the members of my social network in the URL, I have created this route: perfil_miembro: url: /miembros/:nombre_apellidos class: sfDoctrineRoute options: { model: Usuario, type: object} param: { module: miembros, action: show} And added this line in the show action: $this->usuario = $this->getR...

ASP.NET MVC - Routing still confusing for me.

Hi everyone. I'm having difficulty with the concept of Routing within the ASP.NET MVC Framework. For example, I have a controller method: public class UploadController : Controller { public ActionResult Index() { return View(); } [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetChildFolders(string id) {...

How do i change Rails routing from controller/:id to controller/:name in Rails 3?

Hi! Just as the topic say. I want to change the default controller/:id routing to controller/:name instead in Rails 3. In Rails 2 you used named routing with something like this: config/routes.rb map.location 'location/:name', :controller => 'your_controller', :action => 'your_action' alternate named route map.location 'goto/:na...