What is MIME type "text/x-rebol"?

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

text/x-rebol is a MIME type for files that hold REBOL code.
It tells software that the file is plain text with REBOL instructions.
The "x-" prefix marks it as a nonstandard type used for specialized languages.
Files with this type often use extensions like R, R3, or REB.
This designation ensures that systems handle REBOL scripts correctly.
Explore more on MIME types or REBOL at resources like the REBOL website.

Associated file extensions

Usage Examples

HTTP Header

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


    Content-Type: text/x-rebol    
  

HTML

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


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

Associated file extensions

FAQs

Which file extensions are associated with text/x-rebol?

The most common file extensions for this MIME type are .r, .reb, and .r3 (for REBOL 3). It is important to note that the .r extension is also widely used by the R programming language for statistical computing, so checking the MIME type header is crucial for distinguishing between the two. You can learn more about these specific extensions at r or reb.

How do I configure Apache to serve REBOL files correctly?

You can enable support for text/x-rebol by adding a directive to your .htaccess file or the main server configuration. simply add the line AddType text/x-rebol .r .reb .r3. This ensures that when a user requests these files, Apache sends the correct Content-Type header instead of defaulting to text/plain.

Can web browsers execute text/x-rebol files?

No, modern web browsers do not execute REBOL scripts natively. When a browser encounters a file with the text/x-rebol content type, it will typically display the code as plain text or prompt the user to download the file. To run the script, you must have the REBOL interpreter installed on your local machine.

How do I add text/x-rebol support to Nginx?

To serve REBOL files with the correct MIME type in Nginx, you need to edit your mime.types file (usually located in /etc/nginx/). Add the line text/x-rebol r reb r3; inside the types { ... } block, then reload the Nginx service to apply the changes.

Why is the MIME type prefixed with "x-"?

The x- prefix in text/x-rebol indicates that it is a non-standard or experimental subtype that has not been registered with the IANA (Internet Assigned Numbers Authority). While it is not a standard type, it is the conventionally accepted identifier for REBOL source code across the web.

How do I open a file sent as text/x-rebol?

Since these files are human-readable source code, you can open them in any standard text editor like Notepad++, Sublime Text, or VS Code. To actually execute the logic within the file, you will need to pass the file to the REBOL interpreter executable.

Is text/x-rebol safe to open?

As with any source code, text/x-rebol files are plain text and harmless to view in an editor. However, you should never execute a REBOL script from an untrusted source, as the code can perform system operations, modify files, or access the network once run by the interpreter.

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.