Questions tagged [url-routing]

URL routing is the process of mapping a URL to its content.

5061 questions
412
votes
6 answers

Getting full URL of action in ASP.NET MVC

Is there a built-in way of getting the full URL of an action? I am looking for something like GetFullUrl("Action", "Controller") that would return something like http://www.fred.com/Controller/Action. The reason I am looking for this is to avoid…
Alan Spark
  • 8,152
  • 8
  • 56
  • 91
236
votes
18 answers

Vue.js redirection to another page

I'd like to make a redirection in Vue.js similar to the vanilla javascript window.location.href = 'some_url' How could I achieve this in Vue.js?
Jimmy Obonyo Abor
  • 7,335
  • 10
  • 43
  • 71
215
votes
12 answers

Multiple path names for a same component in React Router

I am using the same component for three different routes: Is there anyway to combine it, to…
Chetan Garg
  • 2,167
  • 2
  • 9
  • 3
116
votes
2 answers

Client Routing (using react-router) and Server-Side Routing

I have been thinking and I am confused with the routing between Client and Server. Suppose I use ReactJS for server-side rendering before sending the request back to web browser, and use react-router as a client-side routing to switch between pages…
heartmon
  • 1,411
  • 2
  • 13
  • 14
113
votes
1 answer

React-Router : What is the purpose of IndexRoute?

I don't understand what the purpose of using an IndexRoute and IndexLink. It seems that in any case the code below would have selected the Home component first unless the About path was activated.
Nick Pineda
  • 6,354
  • 11
  • 46
  • 66
110
votes
2 answers

Difference between $state.transitionTo() and $state.go() in Angular ui-router

In AngularJS, I see sometimes we use $state.transitionTo() and sometimes we use $state.go(). Can anyone tell me how they differ and when one should be used over the other?
Barcelona
  • 2,122
  • 4
  • 21
  • 42
88
votes
7 answers

AngularJS dynamic routing

I currently have an AngularJS application with routing built in. It works and everything is ok. My app.js file looks like this: angular.module('myapp', ['myapp.filters', 'myapp.services', 'myapp.directives']). config(['$routeProvider', function…
Greg
  • 31,180
  • 18
  • 65
  • 85
80
votes
6 answers

ASP.NET MVC Routing Via Method Attributes

In the StackOverflow Podcast #54, Jeff mentions they register their URL routes in the StackOverflow codebase via an attribute above the method that handles the route. Sounds like a good concept (with the caveat that Phil Haack brought up regarding…
TorgoGuy
  • 1,316
  • 1
  • 9
  • 10
78
votes
5 answers

Using ASP.NET routing to serve static files

Can ASP.Net routing (not MVC) be used to serve static files? Say I want to route http://domain.tld/static/picture.jpg to http://domain.tld/a/b/c/picture.jpg and I want to do it dynamically in the sense that the rewritten URL is computed on the…
Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
73
votes
8 answers

Flask url_for generating http URL instead of https

I am using url_for to generate a redirect URL when a user has logged out: return redirect(url_for('.index', _external=True)) However, when I changed the page to a https connection, the url_for still gives me http. I would like to explicitly ask…
Blaise
  • 7,230
  • 6
  • 43
  • 53
71
votes
3 answers

Express routes parameter conditions

I have a route on my Express app that looks like this: app.get('/:id', function (request, response) { … }); The ID will always be a number. However, at the moment this route is matching other things, such as /login. I think I want two things…
user1082754
68
votes
4 answers

RegEx to match stuff between parentheses

I'm having a tough time getting this to work. I have a string like: something/([0-9])/([a-z]) And I need regex or a method of getting each match between the parentheses and return an array of matches like: [ [0-9], [a-z] ] The regex I'm using…
Oscar Godson
  • 31,662
  • 41
  • 121
  • 201
62
votes
2 answers

Flask URL Route: Route Several URLs to the same function

I am working with Flask 0.9. Now I want to route three urls to the same function: /item/ /item// /item// The part will never be used in the function. I have…
Gaby Solis
  • 2,427
  • 5
  • 21
  • 27
60
votes
6 answers

Organize routes in Node.js

I start to look at Node.js. Also I'm using Express. And I have a question - how can I organize web application routes? All examples just put all this app.get/post/put() handlers in app.js and it works just fine. This is good but if I have something…
NilColor
  • 3,462
  • 3
  • 30
  • 44
57
votes
9 answers

How can I reload the current page in Ruby on Rails?

I currently have a login popup in my header bar which is on every page in my website. I want to be able to reload the current page that the person is on after a successful login. How do I do this in the controller? def create #declaring and…
EverTheLearner
  • 7,040
  • 16
  • 57
  • 72
1
2 3
99 100