url

Delphi: OpenFileDialog crashes with URL

Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult := OpenDialog1.Execute; But you are allowed to open files from a URL. Delphi 5 ...

What character set should I assume the encoded characters in a URL to be in ?

RFC 1738 specifies the syntax for URL's, and mentions that URLs are written only with the graphic printable characters of the US-ASCII coded character set. The octets 80-FF hexadecimal are not used in US-ASCII, and the octets 00-1F and 7F hexadecimal represent control characters; these must be encoded. It does not, ho...

Windows .url links that point to same address when copied over or deleted

This is really annoying, we've switched our client downloads page to a different site and want to send a link out with our installer. When the link is created and overwrites the existing file, the metadata in windows XP still points to the same place even though the contents of the .url shows the correct address. I can change that URL p...

Django: 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 object. I'd like to learn how to do this without a library so I can get to know Django better....

Mask redirect to temporary domain with mod_rewrite

We are putting up a company blog at companyname.com/blog but for now the blog is a Wordpress installation that lives on a different server (blog.companyname.com). The intention is to have the blog and web site both on the same server in a month or two, but that leaves a problem in the interim. At the moment I am using mod_rewrite to d...

How do I prepend <%= request.getContextPath() %> to all relative URLs inside a jsp page?

The subject says it all, almost. How do I automatically fix jsp pages so that relative URLs are mapped to the context path instead of the server root? That is, given for example <link rel="stylesheet" type="text/css" href="/css/style.css" /> how do I set-up things in a way that maps the css to my-server/my-context/css/style.css instea...

How would I go about creating a mod_rewrite that redirects to launch.php?i=/the/url/that/they/want?

So if the user types mydomain.com/dashboard, the document the server actually sends them is /launch.php?i=/dashboard. The one caveat is that I would like to leave requests for /flags /people /posters /css /icons /images /libraries /patterns alone, and they should request the actual folder. How would I create such a mod_rewrite? ...

What is the best regular expression to check if a string is a valid URL

I need to 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 regex i've already seen on the web. ...

How to get Https URL content

Hi all I have a https link that requires user login & password. If I run it in FX like this: https://[email protected]/link/sublink it will return the xml data as expected. However, what i'm trying to do, is to automate this process. I try to use file_get_contents in PHP fSocket in PHP I even try Ajax, but still.. doesn...

WSDL URL for a WCF Service (basicHttpBinding) hosted inside a Windows Service

I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in .NET (which finally worked) I went along and try to access it from PHP using the SoapClient class. The final consumer will be a PHP site so I need to make it consumable in PHP. I got stumped when ...

Regex to check if valid URL that ends in .jpg, .png, or .gif

I would like users to submit a URL that is valid but also is an image, ending with .jpg, .png, or .gif. ...

Calling JS from Applet: MalformedURLException: unknown protocol: javascript

Hey guys. I read that you could call JavaScript code from a Java Applet by calling JApplet.getAppletContext().showDocument( "javascript:alert('Hello World');" ); However, when I do this i get the following error: java.net.MalformedURLException: unknown protocol: javascript How do I work around this? ...

Struts2 - How to do dynamic URL redirects?

I'm trying to have my struts2 app redirect to a generated url. In this case, I want the url to use the current date, or a date I looked up in a database. So /section/document becomes /section/document/2008-10-06 What's the best way to do this? ...

ASP.NET Routing with Web Forms

I've read ASP.NET Routing… Goodbye URL rewriting? and Using Routing With WebForms which are great articles, but limited to simple, illustrative, "hello world"-complexity examples. Is anyone out there using ASP.NET routing with web forms in a non-trivial way? Any gotchas to be aware of? Performance issues? Further recommended reading I s...

What's the difference between a URI and a URL?

People talk about URLs and URIs as if they're different things, but they look the same to the naked eye. What's the difference between the two? ...

Do you validate your URL variables?

When you're passing variables through your site using GET requests, do you validate (regular expressions, filters, etc.) them before you use them? Say you have the URL http://www.example.com/i=45&amp;p=custform. You know that "i" will always be an integer and "p" will always contain only letters and/or numbers. Is it worth the time to m...

How do configure optional or "extraneous" URLs?

How would you configure/handle extraneous/optional URLs entities (aliases, maybe)? SO is a good example: stackoverflow.com/questions/99999999/ stackoverflow.com/questions/99999999/question-goes-here (bad example, but I couldn't think of better) Amazon URLs are even more confusing (e.g., the Kindle) amazon.com/gp/product/B000FI73MA...

How to tell if a URL parameter needs to be encoded in Java

I'm writing a Java app that is accepting URL parameter values that may or may not be encoded. I need an easy way to tell whether or not I need to encode the parameter string. In other words, I want a function boolean needsEncoding(String param), which will return true if I pass in the String "[email protected]m", and false if I pass in "foo%...

Rewrite all queries to not need the .php extension using a mod_rewrite RewriteRule.

I'd like all queries like http://mysite.com/something/otherthing?foo=bar&amp;x=y to be rewritten as http://mysite.com/something/otherthing.php?foo=bar&amp;x=y In other words, just make the .php extension optional, universally. ...

Regex to validate the index of a website vs. a specific page

I'm looking for a regex that will allow me to validate whether or not a string is the reference to a website address, or a specific page in that website. So it would match: http://google.com ftp://google.com http://google.com/ http://lots.of.subdomains.google.com But not: http://google.com/search.whatever ftp://google.com/search....