url

Modify Address Bar URL in AJAX App to Match Current State

I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state. How are people handling maintaining RESTfulness in AJAX apps? Thanks in advance....

ASP.NET URL Rewriting

How do I rewrite URL's in ASP.NET? I would like users to be able to goto http://www.website.com/users/smith instead of http://www.website.com/?user=smith ...

URL without ID

I see often (rewritten) URLs without ID in it, like on some wordpress installations. What is the best way of achieve this? Example: site.com/product/some-product-name/ Maybe to keep array of page names and IDs in cache, to avoid DB query on every page request? How to avoid conflicts, and what are other issues on using urls without IDs? ...

Can I generate ASP.NET MVC routes from a Sitemap?

I'm thinking of learning the ASP.NET MVC framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hiearachy? Example navigation path: Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick Typical (I think) MVC URL: http://example.com/products/category/NonstickCo...

How do I convert a file path to a URL in ASP.NET

Basically I have some code to check a specific directory to see if an image is there and if so I want to assign a URL to the image to an ImageControl. if (System.IO.Directory.Exists(photosLocation)) { string[] files = System.IO.Directory.GetFiles(photosLocation, "*.jpg"); if (files.Length > 0) { ...

how to get locale information on a GWT application

In GWT I have to specify what locales are supported in my application. The code get compiled in various files, one for each locale (beside other versions), but I have to give my clients one only URL. This URL is supposed to be a page that should be displayed according to the locale preferred by the browser. I dont't want to have an HTTP ...

.NET - Get protocol, host, and port

Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: http://www.mywebsite.com:80/pages/page1.aspx I need to return: http://www.mywebsite.com:80 I know I can use Request.Url.AbsoluteUri to get the complete URL, and I know I can use Request.Url.Authority to get the...

Getting parts of a URL (Regex)

Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using regular expressions: The Subdomain (test) The Domain (example.com) The path without the file (/dir/subdir/) The file (file.html) The path with the file (/dir/subdir/file.html) The URL without the path (http://test.exam...

How do I generate a friendly URL in Symfony PHP?

I always tend to forget these built-in symfony functions for making links. ...

Does new URL(...).openConnection() necessarily imply a POST?

If I create an HTTP java.net.URL and then call openConnection() on it, does it necessarily imply that an HTTP post is going to happen? I know that openStream() implies a GET. If so, how do you perform one of the other HTTP verbs without having to work with the raw socket layer? ...

square brackets in URLs

Are square brackets in URLs allowed? I noticed that Apache commons HttpClient (3.0.1) throws an IOException, wget and Firefox however accept square brackets. URL example: http://example.com/path/to/file[3].html My HTTP client encounters such URLs but I'm not sure whether to patch the code or to throw an exception (as it actually shoul...

How to generate urls in django

In the django template language, you can use {% url [viewname] [args] %} to generate a url to a specific view with parameters. How can you programatically do the same in python code? What I need is to create a list of menu items, each item has name, url, and active (whether it's the current page or not). This because it will be a lot cl...

Friendly URLs for ASP.NET

Python frameworks always provide ways to handle urls that convey the data of the request in an elegant way: think http://somewhere.overtherainbow.com/userid/123424/ I want your to notice the ending path /userid/123424/ How do you do this in ASP.NET? ...

Why do some websites add "Slugs" to the end of URLs?

Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs. For example, the URL the site gives for this question is: http://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls But the following URL works j...

getting java exception: java.net.MalformedURLException: no protocol

I am currently calling the following line of code: java.net.URL connection_url = new java.net.URL("http://:/path"); and when it executes I get the above exception. Any ideas as to why this is happening? ...

How do I register a custom URL protocol in Windows?

How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it? ...

Is it the filename or the whole URL used as a key in browser caches?

It's common to want browsers to cache resources - JavaScript, CSS, images, etc. until there is a new version available, and then ensure that the browser fetches and caches the new version instead. One solution is to embed a version number in the resource's filename, but will placing the resources to be managed in this way in a directory...

Getting a full list of the URLS in a rails application

How do I get a a complete list of all the urls that my rails application could generate? I don't want the routes that I get get form rake routes, instead I want to get the actul URLs corrosponding to all the dynmically generated pages in my application... Is this even possible? (Background: I'm doing this because I want a complete li...

How can I set a timeout against a BufferedReader based upon a URLConnection in Java?

I want to read the contents of a URL but don't want to "hang" if the URL is unresponsive. I've created a BufferedReader using the URL... URL theURL = new URL(url); URLConnection urlConn = theURL.openConnection(); urlConn.setDoOutput(true); BufferedReader urlReader = new BufferedReader(newInputStreamReader(urlConn.getInputStream())); ...

PHP: GET-data automatically being declared as variables

Take this code: <?php if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; } if ($action) { echo $action; } else { echo 'No variable'; } ?> And then access the file with ?action=test Is there any way of preventing $action from automatically being declared by the GET? Other than of course...