Questions tagged [url]

A URL (Uniform Resource Locator), is a universal identifier on the web. A URL is a reference to a web resource at a specific location, and provides a means for retrieving that resource.

The syntax and parsing behavior for URLs is defined in the URL Living Standard web page - this is the current URL standard.

Basically URL has 3 parts:

  • the URL prefix, which specifies the protocol used to access the location
  • the server name or IP address of the server
  • the path to the directory or file(resource)

References

Related tags

43477 questions
975
votes
27 answers

Get the full URL in PHP

I use this code to get the full URL: $actual_link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; The problem is that I use some masks in my .htaccess, so what we see in the URL is not always the real path of the file. What I need is to get…
DiegoP.
  • 45,177
  • 34
  • 89
  • 107
931
votes
5 answers

URL encoding the space character: + or %20?

When is a space in a URL encoded to +, and when is it encoded to %20?
BC.
  • 24,298
  • 12
  • 47
  • 62
900
votes
40 answers

Download single files from GitHub

What are some tips on downloading a single file from a GitHub repo? I don't want the URL for displaying the raw file; in the case of binaries, there's nothing. http://support.github.com/discussions/feature-requests/41-download-single-file Is it even…
Radek Simko
  • 15,886
  • 17
  • 69
  • 107
900
votes
4 answers

Linking to an external URL in Javadoc?

Something like: /** * See {@linktourl http://google.com} */
ripper234
  • 222,824
  • 274
  • 634
  • 905
823
votes
11 answers

Java URL encoding of query string parameters

Say I have a URL http://example.com/query?q= and I have a query entered by the user such as: random word £500 bank $ I want the result to be a properly encoded URL: http://example.com/query?q=random%20word%20%A3500%20bank%20%24 What's the best…
user1277546
  • 8,652
  • 3
  • 17
  • 25
782
votes
34 answers

How to get URL parameter using jQuery or plain JavaScript?

I have seen lots of jQuery examples where parameter size and name are unknown. My URL is only going to ever have 1 string: http://example.com?sent=yes I just want to detect: Does sent exist? Is it equal to "yes"?
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
765
votes
6 answers

What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?

I've just noticed that the long, convoluted Facebook URLs that we're used to now look like this: http://www.facebook.com/example.profile#!/pages/Another-Page/123456789012345 As far as I can recall, earlier this year it was just a normal…
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
760
votes
14 answers

What is a "slug" in Django?

When I read Django code I often see in models what is called a "slug". I am not quite sure what this is, but I do know it has something to do with URLs. How and when is this slug-thing supposed to be used? I have read its definition below in this…
Jonas
  • 19,422
  • 10
  • 54
  • 67
724
votes
9 answers

Hyphen, underscore, or camelCase as word delimiter in URIs?

I'm designing an HTTP-based API for an intranet app. I realize it's a pretty small concern in the grand scheme of things, but: should I use hyphens, underscores, or camelCase to delimit words in the URIs? Here are my initial…
Josh Johnson
  • 8,832
  • 4
  • 25
  • 31
705
votes
30 answers

How do I create a URL shortener?

I want to create a URL shortener service where you can write a long URL into an input field and the service shortens the URL to "http://www.example.org/abcdef". Instead of "abcdef" there can be any other string with six characters containing a-z,…
caw
  • 30,999
  • 61
  • 181
  • 291
675
votes
21 answers

How to get the full URL in Express?

Let's say my sample URL is http://example.com/one/two and I say I have the following route app.get('/one/two', function (req, res) { var url = req.url; } The value of url will be /one/two. How do I get the full URL in Express? For example, in…
Chris Abrams
  • 39,732
  • 19
  • 51
  • 57
628
votes
13 answers

Which characters make a URL invalid?

Which characters make a URL invalid? Are these valid URLs? example.com/file[/].html http://example.com/file[/].html
good
  • 6,311
  • 3
  • 16
  • 5
621
votes
18 answers

Capturing URL parameters in request.GET

I am currently defining regular expressions in order to capture parameters in a URL, as described in the tutorial. How do I access parameters from the URL as part the HttpRequest object? My HttpRequest.GET currently returns an empty QueryDict…
sutee
  • 12,568
  • 13
  • 49
  • 61
594
votes
40 answers

How to build a query string for a URL in C#?

A common task when calling web resources from a code is building a query string to including all the necessary parameters. While by all means no rocket science, there are some nifty details you need to take care of like, appending an & if not the…
Boaz
  • 25,331
  • 21
  • 69
  • 77
572
votes
8 answers

What is %2C in a URL?

In a URL, what does the %2C encoding mean and what are its uses?
sameold
  • 18,400
  • 21
  • 63
  • 87