url-routing

Including a Django app's url.py is resulting in a 404

I have the following code in the urls.py in mysite project. /mysite/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/$', include('mysite.gallery.urls')), ) This results in a 404 page when I try to access a url set in gallery/urls.py. /mysite/gallery/urls.py from django.conf.urls.defaults im...

Rewrite query string "?x=y" style to "/x/y" style

I have a PHP MVC framework I've built from scratch which uses the traditional domain.com/controller/action URL routing. While I'm currently handling the below conversion in the router I'd like to replace them in the URL for cosmetic reasons. For example: controller/action?filter=bank Becomes: controller/action/filter/bank I've don...

URL routing documentation question.

I'm reading about URL routing at How to: Define Routes for Web Forms Applications and there's something in the example I don't understand. If you look at the example provided below, routes.MapPageRoute("", "SalesReport/{locale}/{year}/{*queryvalues}", "~/sales.aspx"); specifically at "SalesReport/{locale}/{year}/{*queryvalues}" W...

How to use rails routes in external classes?

I'm using prawn to generate pdfs, set up ala http://wiki.github.com/sandal/prawn/using-prawn-in-rails I'd like to access my routes so I can generate links in my pdfs, but now I'm not in a template like I used to do with prawnto, so I don't have access to the named routes. class MyPdf < Prawn::Document def to_pdf text root_path ...

Advanced Rails Routing of short URLs and usernames off of root url

I want to have username URLs and Base 58 short URLs to resources both off of the root url like this: http://mydomain.com/username #=> goes to given user http://mydomain.com/a3x9 #=> goes to given story I am aware of the possibilities of a user names conflicting with short urls, and I have a workaround, but what I can't figure out is ...

How to create RouteUrls with databound parameters declaratively?

I'm using the new Routing feature in ASP.NET 4 (Web forms, not MVC). Now I have an asp:ListView which is bound to a datasource. One of the properties is a ClientID which I want to use to link from the ListView items to another page. In global.asax I have defined a route: System.Web.Routing.RouteTable.Routes.MapPageRoute("ClientRoute", ...

JQuery object expected error when accessing page via url routing.

In my global.asax I have url routing setup like below: routes.MapPageRoute("User Logon", "{Vendor}/Logon", "~/Logon.aspx"); In the logon.aspx page, I have a script that "stylizes" the logon button: <link href="jquery/css/flick/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css" /> <link href="images/style.css" rel="styleshee...

How to place search params in URL?

Hi - How do I get a form to submit it's params in the url, such that the rendered page will contain the query (rails 2.3)? Something like this: example.com/search?name=john&age=25&city=atlanta Simple, I know, but I'm not sure how to do it... :) thanks. ...

URL Routing in Java

Coming from other web frameworks, I'm used to being able to map parts of a URL to method parameters. I know that web.xml provides a way to map an entire URL to a Servlet but is there a way to get more features out of this, such as mapping pieces of the URL to method parameters? ...

New to Rails. Doubt in Big URL Routing

Hi, I have just started learning ruby on rails. I have a doubt wrt routing. Default Routing in Rails is :controller/:action/:id It works really fine for the example lets say example.com/publisher/author/book_name Could you tell me how do you work with something very big like this site http://www.telegraph.co.uk/sport/football/leagues...

REST/ROA Architecture - Send database search/querying/filter/sorting parameters in URL? (>, <, IN, etc...)

I'm building a REST interface to my application using ROA (Resource Oriented Architecture). I'd like to give the client the ability to specify search parameters in URL. So a client could say "Give me all people who's: "first_name" is equal to "BOB" "age" is greater than "30" sort by "last_name" I was thinking something like: GET /...

Deploying ASP.NET 4 Web Forms Application Using Routing on IIS 6

To clarify, the scenarios I am looking at involve deploying ASP.NET 4 Web Forms application that employ RouteTable.Routes.MapPageRoute: public class Global : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { RouteTable.Routes.MapPageRoute("questionnaires", "questionnaires", "~/Pages/Questio...

ASP.Net MVC: How to use a virtual path (directory) with a dot (period)?

If I create a new MVC web application project, build and run it the home page comes up as expected. However, if you change the project's Web Properties to use a "Virtual Path" that contains a dot (for example: "Version1.2"), it will fail to work ("The resource cannot be found."). What options are there? ...

Location based URL routing in Rails

Hi everyone, I am new to rails. I want to know more about IP based Location, GeoLocation URL routing. I have 2 questions. The first one.. Based on the location of the country, how to you have URL routing? If my IP is from USA, I should be directed towards USA homepage. If I am from UK, I should be directed from UK homepage. If I...

using rails: how to display all contents of a subfolder in an rails application?

hi, i would like to display the all contents of a folder in my site. For example, under www.mysite.com, I have a folder called "myfiles". In regular apache setting, if I type: http://www.mysite.com/myfiles/ and if myfiles does not have index.html or index.php, then I can get this: **Index of /mysite/myfiles** Parent Directory Chang...

regenerating url in cf9/Coldbox

Hi I am wondering if there is a way to regenerate the URL when any page is loaded in coldbox/CF9 when using event.buildLink ? Currently I get http://cawksd05.codandev.local:8080/entries/editor when using event.buildlink. But the correct url should have /index.cfm added to it as shown below: /index.cfm/entries/editor Is there a way to...

Unexpected htaccess behaviour (mod_rewrite and apache)

Yeah, mod_rewrite is driving me crazy. Here is the problem: my htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [L,QSA] when i try to access the page advantix (so address was www.mywebsite.com/advantix), i'm being redirected to advantix/?url=advantix Looking at the access log, i have a suspicious ...

URL naming conventions

So, this may be a can of worms. But I'm curious what your practices are? For example, let's say your website consists of the following needs (very basic): A landing page An information page for an event (static) A listing of places for that event (dynamic) An information page for each place With that said, how would you design your ...

Site URLs using a PHP "pretty url" framework

I have been experimenting with the lightweight NiceDog PHP routing framework, which routes like this: R('entries/(?<id>\d+)') ->controller('Entries_Controller') ->action('show') ->on('GET') Now the .htaccess file is set up to do this redirect like so: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FI...

Strange routing

How I can setup my rails app to respond to such urls: http://mydomain.com/white-halogene-lamp http://mydomain.com/children-lamps http://mydomain.com/contact-form The first one should link to my products controller, and show my product with this name The second one should link to my categories controller, and show the category with t...