Symlink to a URL

It's not possible to create a symlink to an URL. If you can make executables and the target OS is Linux-alike, you can create a file which opens the URL as in:

#!/bin/sh
x-www-browser 'http://example.com/your/link'

If you are using a GUI desktop in Linux, like Gnome or Unity, you can drag and drop a URL from Firefox and other browsers either onto the desktop or into a folder in the Nautilus file manager. This will create a .desktop file with several lines in it like this one:

[Desktop Entry]
Encoding=UTF-8
Name=Link to Google Calendar
Type=Link
URL=https://www.google.com/calendar/render?pli=1
Icon=text-html

As long as you are in the GUI, you can just double-click on the file to open it into the default Web browser. I do this in Ubuntu to store links to documents in my private Drupal wiki on my machine.

This may work for KDE, xfce, and other desktop managers, but I haven't tried it.


You want an automatic URL link, stored in a file in your file system, to open.

The way to do this is with a minimalist .HTML file. For example, to take you to the Google home page, place the following code in a file named Google.HTML:

<!DOCTYPE HTML>
<html>
  <head>
    <title>Google automatic redirect</title>
    <meta http-equiv="refresh" content="0; url=http://www.google.com/" />
  </head>
  <body>
    <h1>For older browsers, click Redirect</h1>
    <p><a href="http://www.google.com/">Redirect</a></p>
  </body>
</html>

When you open (i.e double click) on this file, the OS will open your default browser (e.g. Firefox) and render this little HTML file, which has a URL redirect in the header, which in turn will automatically open the URL in the redirect.

This can be adapted to take you to the online file as per your question.

The URL contains the protocol (e.g. HTTP), so just make sure that it's in there. To be more minimalist, you can omit the <title> and <h1> lines.

I tried the other answers on this page with Ubuntu 16.04 without success, but this solution works.