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.
43,574
questions
6354
votes
33
answers
4.1m
views
How do I change the URI (URL) for a remote Git repository?
I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved "origin" to a NAS and successfully tested cloning it from here.
I would like to know if I can change the ...
5728
votes
18
answers
1.7m
views
What is the maximum length of a URL in different browsers?
What is the maximum length of a URL for each browser?
Is a maximum URL length part of the HTTP specification?
4968
votes
32
answers
1.3m
views
What is the difference between a URI, a URL, and a URN?
What is the difference between a URL, a URI, and a URN?
3760
votes
26
answers
3.8m
views
Get the current URL with JavaScript?
All I want is to get the website URL. Not the URL as taken from a link. On the page loading I need to be able to grab the full, current URL of the website and set it as a variable to do with as I ...
3030
votes
21
answers
2.1m
views
How do I modify the URL without reloading the page?
Is there a way I can modify the URL of the current page without reloading the page?
I would like to access the portion before the # hash if possible.
I only need to change the portion after the domain,...
2895
votes
22
answers
1.9m
views
Encode URL in JavaScript
How do you safely encode a URL using JavaScript such that it can be put into a GET string?
var myUrl = "http://example.com/index.html?param=1&anotherParam=2";
var myOtherUrl = "http://example.com/...
2694
votes
73
answers
5.3m
views
How can I get query string values in JavaScript?
Is there a plugin-less way of retrieving query string values via jQuery (or without)?
If so, how? If not, is there a plugin which can do so?
2080
votes
41
answers
578k
views
How to lazy load images in ListView in Android
I am using a ListView to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load images so while the text displays, the UI ...
1735
votes
63
answers
2.9m
views
Get the values from the "GET" parameters (JavaScript) [duplicate]
I have a URL with some GET parameters as follows:
www.test.com/t.html?a=1&b=3&c=m2-m3-m4-m5
I need to get the whole value of c. I tried to read the URL, but I got only m2. How do I do this ...
1619
votes
43
answers
1.2m
views
How can I open a URL in Android's web browser from my application?
How to open an URL from code in the built-in web browser rather than within my application?
I tried this:
try {
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));
...
1512
votes
41
answers
490k
views
Path.Combine for URLs?
Path.Combine is handy, but is there a similar function in the .NET framework for URLs?
I'm looking for syntax like this:
Url.Combine("http://MyUrl.com/", "/Images/Image.jpg")
which would return:
"...
1268
votes
62
answers
850k
views
React-router URLs don't work when refreshing or writing manually
I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want.
For instance, I am in localhost/joblist and everything is fine ...
1129
votes
33
answers
571k
views
How do I get the current absolute URL in Ruby on Rails?
How can I get the current absolute URL in my Ruby on Rails view?
The request.request_uri only returns the relative URL.
1057
votes
65
answers
704k
views
What is the best regular expression to check if a string is a valid URL?
How can I check if a given string is a valid URL address?
My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the ...
975
votes
27
answers
4.0m
views
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 ...
952
votes
6
answers
997k
views
URL encoding the space character: + or %20?
When is a space in a URL encoded to +, and when is it encoded to %20?
908
votes
4
answers
311k
views
Linking to an external URL in Javadoc?
Something like:
/**
* See {@linktourl http://google.com}
*/
907
votes
37
answers
1.5m
views
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/...
833
votes
11
answers
1.2m
views
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=...
789
votes
35
answers
1.7m
views
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 ...
766
votes
14
answers
261k
views
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 ...
765
votes
6
answers
120k
views
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, ...
756
votes
8
answers
368k
views
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 ...
704
votes
30
answers
325k
views
How do I create a URL shortener? [closed]
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 ...
690
votes
21
answers
797k
views
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 ...
639
votes
13
answers
701k
views
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
630
votes
19
answers
920k
views
How to get GET request values in Django?
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 ...
609
votes
42
answers
511k
views
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 ...
588
votes
8
answers
694k
views
What is %2C in a URL?
In a URL, what does the %2C encoding mean and what are its uses?
563
votes
38
answers
740k
views
Check if a JavaScript string is a URL
Is there a way in JavaScript to check if a string is a URL?
RegExes are excluded because the URL is most likely written like stackoverflow; that is to say that it might not have a .com, www or http.
526
votes
38
answers
264k
views
Fixed page header overlaps in-page anchors
If I have a non-scrolling header in an HTML page, fixed to the top, having a defined height:
Is there a way to use the URL anchor (the #fragment part) to have the browser scroll to a certain point in ...
520
votes
37
answers
1.1m
views
Adding a parameter to the URL with JavaScript
In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example:
Original URL:
http://server/myapp.php?id=10
Resulting URL:
...
516
votes
26
answers
619k
views
How do I parse a URL into hostname and path in javascript?
I would like to take a string
var a = "http://example.com/aa/bb/"
and process it into an object such that
a.hostname == "example.com"
and
a.pathname == "/aa/bb"
502
votes
8
answers
720k
views
Redirecting to a relative URL in JavaScript
My problem is that I want to redirect via JavaScript to a directory above.
My code:
location.href = (location.href).substr(0, (location.href).lastIndexOf('folder'))
The URL looks like this:
example....
485
votes
19
answers
772k
views
How can I download a file from a URL in C#?
What is a simple way of downloading a file from a URL path?
482
votes
21
answers
1.1m
views
How to check if the URL contains a given string?
How could I do something like this:
<script type="text/javascript">
$(document).ready(function () {
if(window.location.contains("franky")) // This doesn't work, any suggestions?
{
...
475
votes
34
answers
484k
views
How to convert URL parameters to a JavaScript object? [duplicate]
I have a string like this:
abc=foo&def=%5Basf%5D&xyz=5
How can I convert it into a JavaScript object like this?
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
468
votes
8
answers
446k
views
How do I load an HTTP URL with App Transport Security enabled in iOS 9? [duplicate]
So, the new beta SDK of iOS released last night has "App Transport Security" which encourages developers to use https instead of http. In principle, this is a great idea, and I already use https in ...
457
votes
24
answers
539k
views
Refresh image with a new one at the same url
I am accessing a link on my site that will provide a new image each time it is accessed.
The issue I am running into is that if I try to load the image in the background and then update the one on ...
454
votes
6
answers
439k
views
How do I URl encode something in Node.js?
I want to URL encode this:
SELECT name FROM user WHERE uid = me()
Do I have to download a module for this? I already have the request module.
416
votes
6
answers
372k
views
How can I percent-encode URL parameters in Python?
If I do
url = "http://example.com?p=" + urllib.quote(query)
It doesn't encode / to %2F (breaks OAuth normalization)
It doesn't handle Unicode (it throws an exception)
Is there a better ...
412
votes
19
answers
480k
views
Get protocol, domain, and port from URL
I need to extract the full protocol, domain, and port from a given URL. For example:
https://localhost:8181/ContactUs-1.0/contact?lang=it&report_type=consumer
>>>
https://localhost:8181
410
votes
9
answers
207k
views
When should I use a trailing slash in my URL?
When should a trailing slash be used in a URL? For example - should my URL look like /about-us/ or like /about-us?
I am fully aware of the SEO-related issues - duplicate content and the canonical ...
385
votes
7
answers
310k
views
URL encoding in Android
How do you encode a URL in Android?
I thought it was like this:
final String encodedURL = URLEncoder.encode(urlAsString, "UTF-8");
URL url = new URL(encodedURL);
If I do the above, the http:// in ...
381
votes
11
answers
1.0m
views
Get URL query string parameters
What is the "less code needed" way to get parameters from a URL query string which is formatted like the following?
www.mysite.com/category/subcategory?myqueryhash
Output should be: myqueryhash
I ...
373
votes
11
answers
313k
views
How to check whether a string is a valid HTTP URL?
There are the Uri.IsWellFormedUriString and Uri.TryCreate methods, but they seem to return true for file paths, etc.
How do I check whether a string is a valid (not necessarily active) HTTP URL for ...
357
votes
18
answers
213k
views
Should URL be case sensitive?
I noticed that
HTTP://STACKOVERFLOW.COM/QUESTIONS/ASK
and
http://stackoverflow.com/questions/ask
both works fine - actually the previous one is converted to lowercase.
I think that this makes ...
354
votes
18
answers
224k
views
Is there any method to get the URL without query string?
I have a URL like http://localhost/dms/mduserSecurity/UIL/index.php?menu=true&submenu=true&pcode=1235.
I want to get the URL without the query string: http://localhost/dms/mduserSecurity/UIL/...
348
votes
18
answers
565k
views
Get URL parameters from a string in .NET
I've got a string in .NET which is actually a URL. I want an easy way to get the value from a particular parameter.
Normally, I'd just use Request.Params["theThingIWant"], but this string ...
347
votes
51
answers
398k
views
How do I get the YouTube video ID from a URL?
I want to get the v=id from YouTube’s URL with JavaScript (no jQuery, pure JavaScript).
Example YouTube URL formats
http://www.youtube.com/watch?v=u8nQa1cJyX8&a=GxdCwVVULXctT2lYDEPllDR0LRTutYfW
...