What is MIME type "text/url"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

MIME type text/url marks files that contain a web address as plain text. These files serve as Internet Shortcuts and, when activated, direct your computer to open a specific webpage.

A typical file using this MIME type is the URL file. Its content is simple, containing the link to a site, enabling quick access from your desktop or file explorer.

For more technical details, see the MIME types article on Wikipedia.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: text/url    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="text/url">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'text/url');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the structure of a file with the text/url MIME type?

Files with the text/url MIME type, typically ending in .url, follow the standard INI file format. At a minimum, they must contain the header [InternetShortcut] followed by a line reading URL=http://example.com.

Why does my browser display the file content instead of redirecting me?

Web browsers generally treat text/url as a plain text file rather than a server-side redirect or an executable script. To actually follow the link, the file is usually designed to be processed by the operating system (like Windows Explorer) rather than rendered inside the browser window.

How do I configure Apache to serve .url files correctly?

You can explicitly define the MIME type in your server configuration or .htaccess file. Add the line AddType text/url .url to ensure the server sends the correct Content-Type header to the client.

How do I add text/url support to Nginx?

You need to update the mime.types file, usually located in /etc/nginx/. Add the entry text/url url; inside the types block, and then reload the server using sudo service nginx reload.

Is text/url the same as an HTML meta refresh?

No, an HTML meta refresh is a tag inside an text/html document that tells the browser to redirect. A text/url file is a desktop shortcut format used by the operating system to launch a browser instance pointing to a specific address.

Can I create a .url file manually?

Yes, simply create a new text file using Notepad or any code editor. Type [InternetShortcut] on the first line and URL=YOUR_LINK_HERE on the second line, then save the file with the .url extension.

Are there security risks associated with text/url files?

While the file itself is just text and cannot contain viruses, it can direct you to malicious or phishing websites. You should treat these files with the same caution as you would a link in an unknown email.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.