routing

asp.net mvc url routing

i have a classic web project and i want to use asp.net mvc url routing just for rewrite url. is it possible without make much changes to my web project? ...

How do two computers connect to same external address through NAT?

If I have two internal computers connecting to the same external IP address through a NAT router, how is the router able to get the traffic to the correct internal computer? It is my understanding that NAT forwards incoming packets to the computer that recently sent outgoing packets to the [incoming packet's] sender's IP address. Since b...

Redirect to Home/Index when page not found

This has already been asked here but I was hoping there was a nicer "routing" way to do this. Essentially I want to redirect to the Home/Index page when a user enters an incorrect url in my site. EDIT I'm using IIS. ...

Configure Apache to route "GET /user/foo" to /user/GET.php and "PUT /user/foo" to /user/PUT.php

I would like to arrange things so that a GET request for e.g. http://example.com/user/[email protected] internally calls the script /var/www/example.com/rest/user/GET.php and a PUT request for the same URL internally calls the script /var/www/example.com/rest/user/PUT.php and so on for the other HTTP verbs POST and DELETE. It's almos...

How to make a generic redirect when accessed to a / declared in the routes.rb on Ruby on Rails

I have several urls declared in the routes.rb, such as aaa/index.html aaa/bbb.html bbb/index.html bbb/ccc/index so it looks like a non-rails site. I want it so that when a user accesses aaa/ or bbb/ccc/ they would automatically be redirected to the action routed to the index.html of the corresponding directory. currently I am writ...

Strange routing problem in link_to; gotta be something simple

My brain is fried trying to squeeze some work in before the holiday. I'm trying to fix a simple bug. The URLs that the following link_to_remote is creating are wrong: options = { :url => { :controller => 'favorites', :action => 'resort', :params => params.merge({:sort => key, :method => method})}, :update => 'favorites' } html_...

getting a 'name' based URL in RESTful routes instead of an id based url

If I implement RESTful routing for a controller 'galleries' like as follows: map.resources :galleries By default the show url for this controller would be: /galleries/:id which would respond to any requests to /galleries/1 etc. What if I had a gallery record in the database with a 'name' attribute with value 'portraits'. Could I...

Given htmlHelper + action name, how to figure out controller name?

How does HtmlHelper.ActionLink(htmlhelper,string linktext,string action) figures out correct route? If i have this=> HtmlHelper.ActionLink("Edit","Edit") Mvc automatically finds out correct route. i.e. - if controller was Product, it will render anchor with href product/edit. So - how to figure out controller name when i got htmlHe...

Dynamic Routing with an MVC Foundation - i18n and l10n

I've recently been improving my skills with web programming to follow the saner and more maintainable MVC style of coding. However, one thing which I used to do with my "roll your own" framework was flexible dynamic routing based around mod_rewrite. This appears to be a sore issue with things like cakephp, zend, etc.. and its causing me ...

CodeIgniter routing problem

Hello , I'm trying to build a short uri service with CI just so i can learn CI faster anyway .. i got stuck at the routing i hid the index.php then added the following route $route['([A-z0-9]{4})'] = "/forward/redirect/$1"; but it just shows my default controller i also tried with htaccess RewriteBase / RewriteCond %{REQUEST_FILE...

Make URL in ASP.Net user-friendly

I'm trying to develop my first site in ASP.Net using Web Forms. I have a form with some controls and a TextBox control. While now I use GETrequest. When user submits a form his browser expects to get long URL, something like http://mysite.com/search.aspx?__VIEWSTATE=%2FwEPDwUJNTE2NjY5jMY4D2QWAgICD2QWAgIDDW8wAh4EVGV4dAUBMWRkZKthQ0zeIP5...

MVC - Routing not working within intranet

Hi, I don't know anyone can help but I'd appreciate any. I am developing an app in mvc (c#), now I had various routes working on my local development machine when the app was stand alone however now I've tried adding the project to the test intranet at work and none of the routes are working. So where Localhost/Admin/Create worked fine...

How can I guess action name from url in Rails?

For example I have a url generated by something_path or something_url methods. I need to know action name from that url. ...

Can you determine the name of the route followed from your webforms page?

Hi there, I have a ASP.NET 3.5 webforms project I have enabled routing over. I also have in the project a number of controls doing different things based on what page they are currently being shown in. It would seem that the most straightforward way to control this different behavior is to discover which route was used to load the page...

How to applications listen in local network on internet ?

I was wondering that how application like skype ( a popular chat client ) works in local network with one router, How it can listen on particular port? for example:= In one network A and B are two machines running skype , gateway of both is G1, now how A and B will have same IP on internet that is of G1, but how can they ensure that...

Is there an equivalent to Ruby on Rails' respond_to format.xml, etc in ASP.Net MVC?

In Ruby on Rails you can write a simple controller action such as: def index @movies = Movies.find(:all) respond_to do |format| format.html #index.html.erb format.xml { render :xml => @movies } format.json { render :json => @movies } end end For those unfamiliar with RoR, def index in this case wo...

Best way to do "/blogs/:year/:month/:day/:permalink" routes in Rails?

I've got a blogs_controller with a Blog resource, so I've got your typical routes right now as follows: /blogs/new /blogs/1 /blogs/1/edit #etc But here's what I want: /blogs/new /blogs/2010/01/08/1-to_param-or-something /blogs/2010/01/08/1-to_param-or-something/edit #etc ... /blogs/2010/01 # all posts for January 2010, but how to spe...

Response.RedirectToRoute with an action specified

I wish to redirect to a route but also specify the action to run on that route's controller. I tried this: Response.RedirectToRoute("Login", new { action = "ChangePassword" }); The action looks like this: public ActionResult ChangePassword() {} The route looks like this: routes.MapRoute("Login", "Login/{action}", new { controller...

How can I route users to different functions based on their privileges in CakePHP?

This may have been asked before, and I have seen similar solutions... Perhaps I am thinking about this incorrectly. I would like to have one link called user/edit if the user is an admin it should route to admin_ if they are a basic user it should route to user_ etc... Is there a way to do this in a slick way? I have seen solutions tha...

Complex Rails Routing

I would like to do something like github has with nested urls, and like http://stackoverflow.com/questions/1863292/how-do-i-route-user-profile-urls-to-skip-the-controller but not really sure how to go on with it. For example, looking at a commit they have: ':user/:repo/commit/:sha', with the controller being commit. How would I replica...