What is MIME type "text/richtext"?

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

The MIME type text/richtext designates files that carry simple styled text. They contain basic formatting instructions without the complexity of full HTML. Files with this MIME type, like RTX, use lightweight commands for text styling.


Programs read the MIME type to decide how to render the text. For more details, visit Rich Text Format on Wikipedia.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: text/richtext    
  

HTML

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


    <a href="file.dat" type="text/richtext">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/richtext');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the primary file extension for text/richtext?

The standard file extension associated with text/richtext is .rtx. While it shares similarities with other rich text formats, the .rtx extension specifically denotes files using the formatting commands defined in early MIME standards (RFC 1341).

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

You can enable support by adding the AddType directive to your server's configuration or .htaccess file. Add the line: AddType text/richtext .rtx to ensure the server sends the correct Content-Type header.

Is text/richtext the same as Microsoft's RTF format?

No, they are distinct formats despite the similar names. Microsoft's Rich Text Format usually uses the MIME type application/rtf or text/rtf and the extension .rtf. The text/richtext type (often .rtx) refers to an older standard primarily designed for email systems.

Why do modern browsers download .rtx files instead of displaying them?

Most modern web browsers (like Chrome or Firefox) do not have built-in rendering engines for text/richtext. Because they cannot natively display the formatted content, they default to downloading the file so it can be opened by a compatible local application.

How does text/richtext differ from text/html?

The text/richtext format is significantly simpler and more limited than text/html. While HTML allows for complex layouts, scripting, and multimedia embedding, text/richtext was designed only for basic formatting like bolding, italics, and indentation.

What is the Nginx configuration for text/richtext?

To serve these files correctly in Nginx, locate your mime.types file (usually in /etc/nginx/). Ensure the following line exists inside the types block: text/richtext rtx;. If you modify this file, remember to reload Nginx.

Are there security risks associated with text/richtext?

This MIME type is generally considered safe because it does not support executable scripts or active content (like JavaScript). It is strictly a formatting language, meaning it cannot run code on a user's machine, unlike complex application/pdf or HTML files.

Is text/richtext still widely used?

No, it is largely considered obsolete. It was superseded by text/enriched and eventually by HTML for rich text in emails and web pages. Developers should generally use text/html for modern applications unless supporting legacy systems.

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.