url-routing

Is there a way to make MVC.NET routing ignore a few /dir/paths/ ?

Meaning I could have the URL routing start at like site.com/v3/site/controller/action basically it would ignore the v3/site/ and treat that as root? ...

How to use System.Web.Routing to not URL rewrite in Web Forms?

I am using System.Web.Routing with ASP.NET (3.5) Web Forms that will URL rewrite the following URL from http://www.myurl.com/campaign/abc to http://www.myurl.com/default.aspx?campaign=abc The code is as below: public static void RegisterRoutes(RouteCollection routes) { routes.Add("CampaignRoute", new Route ...

Passing PHP arguments into NetBeans into a page that features symfony url-routing

I am doing the Jobeet tutorial that features url routing. The url routing (I think that's the proper term) makes urls look like this http://localhost:8080/frontend_dev.php/job/extreme-sensio/paris-france/2/web-designer I would like to debug into this page however I cannot properly pass arguments into NetBeans. I set the arguments in...

Adding a link to a static file with a custom URL on Symfony

When using Symfony 1.0, is it possible to create a link to a static file i.e. a PDF or DOC file and link to it a custom URL? I'd like to add a file e.g. example.pdf to the web/uploads/pdf folder on the server but then link to it with a URL such as: http://www.example.com/docs/old/test/example.pdf This situation has arisen because some ...

ASP.NET MVC Routing strategy for static content for each View

I'm wanting for every view in my system to have some static help content. The way I was thinking about doing this would be to set up a parallel structure for the static content and create a route to rewrite the URL to this. For instance: /Controllers /Help /Account /Login.htm /Create.htm /Models /Views /Account /Login....

How to transform ASP.NET URL without URL routing or URL rewrite?

I am using ASP.NET 2.0 on IIS6 therefore I can’t use system.web.routing. I’ve tried a few URL rewriters but none did what I wanted. I basically need to transform (read/parse then redirect) URL 1 into 2 with minimum IIS configuration because I don't have the full authority to reconfigure web servers (i.e. ISAP on IIS6 or install 3rd part...

Tips on writing/designing a URL Router in PHP using OOP

I love the elegance of Zend_Controller_Router_Rewrite and the various route classes it uses. I'd like to write a very similar routing system as a standalone component so I can translate URLs into a set of parameters and assemble them back again. The idea is to use them to select, say, an URL normalization handler on a per-path basis. ...

ASP.net MVC support for URL's with hyphens

Is there an easy way to get the MvcRouteHandler to convert all hyphens in the action and controller sections of an incoming URL to underscores as hyphens are not supported in method or class names. This would be so that I could support such structures as sample.com/test-page/edit-details mapping to Action edit_details and Controller tes...

Refactoring an algorithm

I'm trying to re-implement ASP.NET MVC routing rules in C++ for my own MVC application. Currently the code takes at least O(N) at best case and more if accessing the controller/action inside an unordered_map is not O(1). I would like my code to prefer a route with a controller that's already in the URI, for instance if the current URI is...

Tomcat serving URLs wrong with mod_proxy and apache

I've set up a host with apache to serve static pages and to use Tomcat to serve my web application (See this question). The static pages are server from "http://myhost.com" and the dynamic (tomcat) pages are server from "http://myhost.com/myapp" The mod_proxy makes sure the "http://myhost.com/myapp" are forwarded to tomcat server run...

Can I do this in ASP.NET MVC routing?

I'm trying to do a site like http://example.com which goes to my SignIn action located at the Account controller. After signing in, I want to redirect to something like http://example.com/id where id is the user's ID. I already have this code in my Global.asax.cs. routes.MapRoute("Login2", "{bg}/{controller}/{action}", ...

mvc route problem - using integer parameters

I have a route like this in my global.asax.cs: routes.MapRoute( "NewsArticles", "News/{page}", new { controller = "News", action = "Index", archive = false } ); How can I restrict access to this route so that it's only encountered if the user uses an integer? ...

RewriteRule to redirect tp a page for a second subfolder variable

FTR, I'm pretty abysmal at rewrite rules. We've got a number of users who each have their own projects. Right now we've got the RewriteRules set up so that when someone just types mysite.com/username it goes to the user's profile at, f.e., mysite.com/work/user_name.php?u=000 But what we really need is, when someone types in mysite.co...

Serving HTML or ASPX files with ASP.NET MVC

I want to implemented URL like : www.domain.com/Business/Manufacturing/Category/Product1 This will give the details of specific product(such as specifications). Since the list of Categories & Products in each Category are limited, I thought it is not worth to use database for products. So I want to implement it using the HTML or ASP...

How can I implement vanity URL's in a Rails application?

I want users to able to have a profile page at site.com/myNameHere. Rails looks for a controller named "myNameHere." Is it possible to setup routes.rb so that if the controller is not found, "myNameHere" gets sent as a parameter to another controller? ...

Simple MVC routing problem

I have few pages that quite similar to the others but one of them doesn't work. When I write 'http://localhost:2265/Segment/' I get annoying error message "Server Error in '/' Application. The resource cannot be found." Other pages like 'http://localhost:2265/User/' works very well AND also 'http://localhost:2265/Segment/Create'. So I...

mvccontrib test helper and verifying http post routes and parameters

In my Asp.net MVC app, I have two methods on a controller, one for when the user first arrives on the view and then one when they submit the form on said view. public ActionResult Foo() {} [AcceptVerbs(HttpVerbs.Post)] public ActionResult Foo(string id, Account accountToFoo) {} In the second action, there's a custom model binder that...

What's the best way to access a URI variable after a hashtag from php?

I have javascript updating my URI as below: /index.php?page=list#page=news But I would like to make page=news accessible somehow from my server so that when the URI is copied and pasted, it would go to the news page. What is the best way to do this ? I tried $_SERVER['REQUEST_URI'] but everything stored in $_SERVER is before the hash...

Mapping action input variables to an array via a route, with constraints

Hi there, I am trying to map a number of querystring variables into an array that is one of the parameters for an action method. The action method is as follows: public ActionResult Index(string url, string[] generics) { //controller logic here } We can easily get MVC to bind to the variable generics by using a querystring such as...

Using a Modifing a Radix Tree for implementing a URL matching algorithm

I am refactoring this algorithm completely. Basically I am re-implementing the ASP.NET MVC in C++ for another framework. I'm trying to implement a URL matching algorithm and I figured that radix tree would be the best choice for the keys searching because some url prefixes might be shared. Also searching may be very efficient considerin...