url-routing

SiteMap and Url routing

I have a question similar to the one described here: ASP.NET URL Routing with WebForms - Using the SiteMap My ASP.Net WebForms webapplication has a Sitemap, similar to this: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode title="Root"> <siteMapNode url="...

Rails map.resources & Helper Urls

I have two models like this: class Topic < ActiveRecord::Base has_many :articles end class Article < ActiveRecord::Base belongs_to :user belongs_to :topic has_many :comments end I have setup the resource mapping like so: map.resources :topics do |topic| topic.resources :articles end And I can view the articles just fine ...

Using a dash (-) instead of a plus (+) in Zend Framework URLs

by default it seems my ZF is separating multiple parameter words with plus signs. eg. /product/test+product+name I would like to use -> /product/test-product-name Here is the line from routes.ini routes.product.route = "product/:productName"<br /> routes.product.defaults.controller = product<br /> routes.product.defaults.action ...

How to make ASP.NET Routing escape route values?

I have an ASP.NET MVC site where I want routes like /{controller}/{id}/{action}/{date}, where "date" is the mm/dd/yyyy portion of a date/time. (I'm dealing with time-dimensioned data, so I need both an ID and a point in time to do most operations) The route for this is simple: routes.MapRoute( "TimeDimensionedRoute", "{controll...

What makes an effective URL Mapping implementation and why?

I am looking at implementing URLMapping for a personal project. I am already aware that solutions exist so please do not answer suggesting I should use one. What I want is to harvest the opinions of fellow developers and web users on URL mapping implementations. Specially I would like you to answer: Which is your favourite implementa...

Page.GetRoutUrl in a static method

Some background on what I'm doing I usually like to have my pages return the url needed to access it. So i will normally have a method like so public partial class ProductDetails : Page { public static string GetUrl(Guid productId) { return "fully qualified url"; } } on my other pages/controls that need to access ...

Why is Rails encoding slashes for catch all (splat) routes?

When using a catch all route the URLs have the forward slash encoded as %2F which means I can not lookup a record using request.path map.document '*path', :controller => 'documents', :action => 'show' Page.find_by_permalink('/blog/my_first_post') # Record found Page.find_by_permalink('blog%2Fmy_first_post') # Record not found Firstly...

Getting ASP.NET MVC to correctly escape the # (hash/pound) character in routes

I've got a route that looks like this: routes.MapRoute( "BlogTags", "Blog/Tags/{tag}", new { controller = "Blog", action = "BrowseTag", viewRss = false } ); And I create a URL using that route like this: <%= Html.RouteLink(Html.Encode(sortedTags[i].Tag), new { action = "BrowseTag", tag = sortedTags[i].Tag })%> However, wh...

Wordpress URL routing problem

I was wondering which is the best approach to get the catgeory ID when listing the posts within a particular category. Normally, the urls look something like this : www.example.com/?cat=4 and it is pretty easy to get the id. However, I really need the urls to be routed like this www.example.com/categories/hotels . wordpress provides an e...

Symfony route url (variable joined to a literal)

I'd like to generate an URL like this one: /MyCategory/MySubCategory/page2.html I have tried to do it this way: my_route: url: /:variable1/:variable2/literal:variable3.html But Symfony outputs this: /MyCategory/MySubCategory/page:variable3.html I'm using Symfony 1.4.1 How could I solve this? ...

What is the opposite of url_for in Rails? A function that takes a path and generates the interpreted route?

Hi there, Brain's a little fried....How do I get a hash of the :controller and :action from a relative_path? This is basically the opposite of url_for. in the example below, "some_function" is the mystery function name I'm looking for...I know it's easy, just can't remember or seem to be able to find it in the docs. Like so: some_fun...

Zend_Controller_Router: Get language from translated segment

I want to use a URL rewrite on my site: /:@controller/:@action/ So I want to use translated segments on route and I want to detect requested language from these translated segments. For example, if user request a url like this: /user/profile/ then I could understand that requested language is English. And if user request a url like...

Configuring IIS 7 & ASP.NET App for URL Routing

This is not an MVC topic. I have an ASP.NET Application which performs URL Routing in the Application_Start method. The routing looks like: RouteTable.Routes.Add(new Route( "Profile/{query}", new RouteValueDictionary() { {"query",string.Empty} }, new GenericRouteHandler("~/ProfileHttpHandler.ashx") )); A GenericRouteHandler loo...

Url routing and web.config of nested folder

I'm using URL routing (with WebForms) in the following format: http://host/project/{projectid}/{pageName} Another option is that the user is refering to a subapplication: http://host/project/{projectid}/{application}/{pageName} The subapplication isn't a new web application, simply a virtual directory. My subapplication does have...

jQuery with Rails when deployed to multiple subURIs

Hey. So I have a Rails app that's getting deployed to a production machine that serves it via Apache/Passenger to two subURIs. /app /app_2 both the above subURIs are running the same codebase. It's just two symlinks to the public dir that are both pointed to via Passenger by: RailsBaseURI "/app" RailsBaseURI "/app_2" Now, imma big ...

Url helper in java script

I'm using jquery lightbox for image gallery. Url to the button image is '../../Content/Lightbox/lightbox-btn-next.gif' That work fine if my url is 'localhost/Something1/Somtehing2' If I use another route like 'localhost/Something1/Something2/Something3' then url to button images is incorrect. Can I use Url.Action() inside .js files? T...

How to dynamically create routes in a HTML actionlink

I am trying to send the route values to a method but I cant seem to figure this out. Here is my code <% string s = "cool"; object d = new { s = "1" }; %> <%= Html.ActionLink("Home", "Index", d, "ql")%> The following code produces a url like this http://localhost:49450/?s=1 the url should be like this http://localho...

Route web requests to different servers based on subdomain

First of all, I've seen this: http://stackoverflow.com/questions/589669/how-to-redirect-different-sub-domain-requests-to-different-servers But my problem is different. I have a platform where a user can create a new website using a submdomain. There will be thousands of these, eg abc.mydomain.com, def.mydomain.com . Hopefully if we ar...

ASP.NET cms and display template - 2 projects or just 1?

This is a ASP.NET MVC beginner question (I'm in phase of developing NerdDinner)... I have assignment to create ASP.NET MVC cms (with its own design) and portal (also with its own design) that will display data that's being handled by CMS. I was wondering if I will have to make two individual projects in Visual Studio or I will have to us...

How to get started with URL Routing in an asp.net webform application?

Thus far working with asp.net webforms was very easy .... But never implemented URL Routing in webforms... I know asp.net MVC Handles URL Routing pretty well... How to get started with URL Routing in an asp.net webform application? For EX: Say http://www.mydomain.com/Forms/Category.aspx i want it to be like http://www.mydomain.com/Fo...