routing

ASP.NET MVC generates URLS starting with '/', are relative possible?

ASP.NET MVC helpers generates URLs with slash, I use <base /> tag for my project, so it possible to place application to folder. Is it possible to generate relative URLs without first slash? Thanks! ...

Duplicate content in ASP.NET MVC because of custom routes MapRoute(), are areas the rescue?

I use custom routes for my URLs and my action become accessible via two URLs (not counting trailing slash and lower\upper case letters): one via my custom route /my-custom-route-url/ and one via default /controller/action. I see one possible solution -- put all controllers which use default routing (they are mostly backend) in one area,...

ASP .Net web form URL Routing. Is it possible to exclude routing in some cases?

I am using ASP .NET Webforms. I am registering the routes in Global.ascx. I have a route like this: routes.Add("FormsRoutes", new System.Web.Routing.Route("Docs/", new FormsRouteHandler())); the route handler is given below: public class FormsRouteHandler : IRouteHandler { #region IRouteHandler Members public IHttpHandler Ge...

Rails parse url to hash(Routes)

Hello. How can I parse url string to hash like {:controller => 'controller_name', :action => 'action_name', :id => 'id'} ? ...

routes in rails 3 .. basic routes issue

I m having a controller users in which there are three actions show, update and prepare and there respective views in views/users directory Now when i am trying this:-- http://localhost:3000/users/prepare I am getting an error No route matches "/users/prepare" can anybody explain me how to specify this routes in routes.rb for this...

how to acess user session in sfDoctrineRoute with symfony ?

how to acess user session in sfDoctrineRoute with symfony ? var_dump(sfContext::getInstance()->getUser()); returns NULL i cant access current user session in routing http://stackoverflow.com/questions/2455817/symfony-accessing-user-session-from-a-custom-routing-class = bad response ...

Comparing route to current request in Symfony

For my site navigation I'd like to indicate the current page. If each page in the navigation has its own route is there a way to see if the current request matches the route? Something like: $request->getRoute() == '@my_route' Or, more generally, is there an idiomatic way of setting the active page when creating site navigation in Symf...

How do I create Twitter style URLs for my app - Using existing application or app redesign - Ruby on Rails...

I have developed a blog application of sorts that I am trying to allow other users to take advantage of (for free and mostly for family). I wondering if the authentication I have set up will allow for such a thing. Here is the scenario. Currently the application allows for users to sign up for an account and when they do so they can cr...

asp.net mvc routing id parameter

Hi Experts, I am working on a website in asp.net mvc. I have a route routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); which is the default route. Now I have method public...

Symfony custom route works with frontend_dev.php but not with index.php

Am I missing something or should my custom route work with the index.php (or nothing) instead of frontend_dev.php? I'm getting a 500 error when I go to the model, and a 404 for the show page. My route is: project_show: url: /project/:slug class: sfDoctrineRoute options: { model: Project, type: object } param: { module: p...

Is it possible to have a .NET route that maps to the same place as a directory?

I'm building a CMS using WebForms on .NET 4.0 and have the following route that allows URLs like www.mysite.com/about to be mapped to the Page.aspx page, which looks up the dynamic content. routes.MapPageRoute("page", "{name}", "~/Page.aspx"); The problem is that I have a couple of folders in my project that are interfering with poss...

Simple rails routing / url question

I'm using Ryan Bates' nifty authentication in my application for user signup and login. Each user has_many :widgets, but I'd like to allow users to browse other users' widgets. I'm thinking that a url scheme like /username/widgets/widget_id would make a lot of sense--it would keep all widget-related code in the same place (the widgets ...

Injecting multi-tenant repositories with StructureMap in ASP.NET MVC

I'm implementing StructureMap in a multi-tenant ASP.NET MVC application to inject instances of my tenant repositories that retrieve data based on an ITenantContext interface. The Tenant in question is determined from RouteData in a base controller's OnActionExecuting. How do I tell StructureMap to construct TenantContext(tenantID); wher...

ASP.NET MVC search route

I setup a search route: routes.MapRoute( "Search", "Search/{q}", new { controller = "Search", action = "Index" } ); The search form has an input box and a button. I want the search with a GET as below. <% using(Html.BeginForm("Index", "Search", FormMethod.Get)) {%> <%:Html.TextBox("q")%> <span class="query-button"> ...

Images not shown when publishing MVC application to virtual directory inside default web-site

Hi! I am developing an application using ASP.NET MVC 1 and VS2008. When I deploy it to the default web-site in my IIS6 on WinXP, all images are shown correctly, path to any given image is localhost/Content/ImagesUI/[image].[ext] When I deploy it to the virtual directory, created inside the same site, any image request returns IIS stand...

Python: get default gateway for a local interface/ip address in linux

On Linux, how can I find the default gateway for a local ip address/interface using python? I saw the question "How to get internal IP, external IP and default gateway for UPnP", but the accepted solution only shows how to get the local IP address for a network interface on windows. Thanks. ...

How to make parameters optional when using Rails named routes?

I have a named route: map.find '/find/:category/:state/:search_term/:permalink', :search_term=>nil, :controller=>'find', :action=>'show_match' and the following URL matches it & works OK: http://localhost:3000/find/cars/ca/TestSeachTerm/bumpedupphoto-test but if I take out the 2nd last parameter i.e. "TestSearchTerm", then the rout...

Aliasing a namespaced route in Rails

Hi all, Given the following routes.rb file: # Add Admin section routes map.namespace :admin do |admin| admin.resources :admin_users admin.resources :admin_user_sessions, :as => :sessions admin.resources :dashboard # Authentication Elements admin.login '/login', :controller => 'admin_user_sessions', :action => 'new' ...

ASP.NET MVC: Html.Actionlink() generates empty link.

Okay i'm experiencing some problems with the actionlink htmlhelper. I have some complicated routing as follows: routes.MapRoute("Groep_Dashboard_Route", // Route name "{EventName}/{GroupID}/Dashboard", // url with Paramters new {controller = "Group", action="Dashboard"}); ...

CodeIgniter URI routing (dynamic, multilingual)

I'm trying to redirect all routs to one main controller. Here is my routes.php $route['default_controller'] = "main"; $route['scaffolding_trigger'] = ""; //$route['(\w{2})/(.*)'] = '$2'; //$route['(\w{2})'] = $route['default_controller']; $route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1"; $route['(:any)'] = $route['d...