url-routing

asp.net mvc - Route for string or int (i.e. /type/23 or /type/hats)

Hi guys I have the following case where I want to accept the following routs '/type/view/23' or '/type/view/hats' where 23 is the Id for hats. The controller looks something like this: public class TypeController { [AcceptVerbs(HttpVerbs.Get)] public ActionResult View(int id) { ... } } Now if they pass in...

URL Rewriting multiple folders to one folder

Hi, I'm using IIRF on IIS6/Server03 with an MVC app in the root of the server and a virtual directory for the wordpress blog/cms. I'd ideally like the urls as follows... domain.com/ domain.com/wpcategory/ -> rewritten from domain.com/blog/wpcategory/ domain.com/wpcategory/wparticle/ -> rewritten from domain.com/blog/wpcategory/art...

Deploying asp.net mvc iis6.0 how to change route TO include .aspx

Hi guys This is my routing tables where do I put the various '.aspx' registrations? //Turns off the unnecessary file exists check this._Routes.RouteExistingFiles = true; //Ignore text, html, xml files. this._Routes.IgnoreRoute("{file}.txt"); this._Routes.IgnoreRoute("{file}.htm"); this._Routes.IgnoreRoute("{file}.html"); this._Routes....

Does main.py or app.yaml determine the URL used by the App Engine cron task in this example?

In this sample code the URL of the app seems to be determined by this line within the app: application = webapp.WSGIApplication([('/mailjob', MailJob)], debug=True) but also by this line within the app handler of app.yaml: - url: /.* script: main.py However, the URL of the cron task is set by this line: url: /tasks/summary So ...

Flash XML config file problems with asp.net MVC

I'm creating an asp.net MVC app, first time I've done this. I have a flash component I need to use in a view. I have included the SWF files etc in the Contents folder and referenced it from my view, the flash file loads when you get to the view, great. The problem occurs because the flash file references and XML file for its configurati...

ASP.NET Alternative to Shorty

Does anyone know of an ASP.NET alternative available for Shorty (http://get-shorty.com/)? ...

Zend Router overwrites post variables from form

We are using the Zend Router and it seems that its overwriting the parameters that are sent by forms. The only parameters that arrive to the controller are the params from the Url. Does anyone know why this is happening? Here is the config file: ; Routing config routes.groups.route = groups/:group/:type/:idPost/:postUrl/:page routes...

how would i design a db to contain a set of url regexes (python) that could be matched against an incoming url

Say I have the following set of urls in a db url data ^(.*)google.com/search foobar ^(.*)google.com/alerts barfoo ^(.*)blah.com/foo/(.*) foofoo ... 100's more Given any url in the wild, I would like to check to see if that url belongs to an existing set of urls and get the corresponding data field. My questi...

How can I implement this on asp.net or asp.net mvc

Me and my team are creating a portal on asp.net mvc. We want to create such an url for the users page : http://user.portal.com/ . How can we implement this in mvc or just asp.net. ...

Removing null/empty keys from a query string in asp.net MVC

Is there a way I can remove null or empty keys from a query string in asp.net MVC? For example I have a page where I filter data on a results table, if I search for John the query string would be redisplayed as: candidates?FirstName=John&LastName=&Credit=false&Previous=false&Education=&Progress= and not candidates?FirstName=John I ...

ASP.NET MVC URL Routes

In ASP.NET MVC, is it possible to define routes that can determine which controller to use based on the data type of part of the URL? For example: routes.MapRoute("Integer", "{myInteger}", new { controller = "Integer", action = "ProcessInteger", myInteger = "" }); routes.MapRoute("String", "{myString}", new { controller = "String", ac...

ASP.NET MVC Routing Questions

I just started using ASP.NET MVC and I have two routing questions. How do I set up the following routes in ASP.NET MVC? domain.com/about-us/ domain.com/contact-us/ domain.com/staff-bios/ I don't want to have a controller specified in the actual url in order to keep the urls shorter. If the urls looked liked this: domain.com/comp...

ASP.NET Routing

I have a small task to do, and figured it would be better to start here than doing it wrong then coming here again. I need to replace my URLs with a more friendly format as the following: Current: www.MySite.com/default.aspx?userID=XX I want it the users to type : www.MySite.com/user/(UserName) Also, Current: www.MySite.com/default.aspx...

Making correct use of chained routes in Zend Framework

I'm working on a multilingual site using the new Zend Framework (1.8), but I'm running into some trouble with the URL routing. It might be that I interpreted its meaning incorrectly, but well, never too late to learn. So, what's basically happening: The site consists of several parts, e.g. 'devices' and 'articles'. The plan is to form t...

Has namedspaced routing changed in Rails 2.3?

I have an admin namespace which gives me the usual routes such as admin_projects and admin_project, however they are not behaving in the usual way. This is my first Rails 2.3 project so maybe related I can't find any info via Google however. map.namespace(:admin) do |admin| admin.resources :projects end The strange thing is for a gi...

Chevrons in Routing URLs with WebForms 3.5

I've just upgraded my old wildcard mapping based URL system to use System.Web.Routing. Before, I was able to request the URL /Service/GetItems<My.Full.Item.Type>, which was parsed on the other side and returned exactly what you'd expect. That was neat. Now with Routing on, any request with a < or > in it returns me the contents of '/'...

URL Constraint for numeric IDs

Hi folks, I am trying to create some URL constraints for controllers to prevent null reference exceptions. For example /folder/edit/3 should be okay /folder/edit/asdf shouldn't be okay Instead of adding a Regex on every action method I want to use URL constraints for that. The Problem I am facing right now is that the default route...

What's the difference between example.com/controller and example.com/controller/ in Rails?

Hi there, I have a PostsController, not essential to the example but will help when I paste snippets, and I'm using current_page? to, as the name implies, figure out what page is being displayed. I'm getting what seem like weird results. current_page? will return different answers if I go to /posts vs. /posts/. As a test, on the index...

URL Mapping help needed...

I Have url like "http://www.mysite.com/aspx/downloaddoc.aspx?J01001" I want this to be easily accesible by typing out: "http://www.mysite.com/Whitepapers/J01001" What would be the best way to achieve this? Thanks in Advance Shashi. ...

How to have a domain redirect to a subdirectory?

Using only DNS, how can I have http://www.example.com/ either redirect or resolve to http://www.anotherdomain.com/example ? UPDATE: Since it's been mentioned below that DNS cannot be used, what's the next best alternative (minimize load on server and provides the fastest redirect experience for the user) ? ...