]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Bug 64596: Document that extensionless files cannot be matched by mod_mime; show...
authorRich Bowen <rbowen@apache.org>
Sat, 2 May 2026 19:40:57 +0000 (19:40 +0000)
committerRich Bowen <rbowen@apache.org>
Sat, 2 May 2026 19:40:57 +0000 (19:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933715 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_mime.xml

index a3c58f862efc72ea060624abad8c9d311ed90e99..6327a28edbaea9e411d4e952cf2809ab9a6b12ce 100644 (file)
@@ -151,6 +151,30 @@ module="mod_mime_magic">MimeMagicFile</directive></seealso>
     </highlight>
     </example>
 
+    <note><title>Files with no extension</title>
+    <p>Files with no extension (such as <code>Makefile</code>) cannot
+    be matched by <module>mod_mime</module>'s extension-based directives.
+    To set the content type or charset for such files, use a
+    <directive type="section" module="core">Files</directive> or
+    <directive type="section" module="core">FilesMatch</directive>
+    section instead:</p>
+
+    <highlight language="config">
+# For a specific file:
+&lt;Files "Makefile"&gt;
+    ForceType text/plain
+    AddDefaultCharset UTF-8
+&lt;/Files&gt;
+
+# For all files with no extension:
+&lt;FilesMatch "^[^.]+$"&gt;
+    ForceType text/plain
+    AddDefaultCharset UTF-8
+    AddDefaultCharset UTF-8
+&lt;/FilesMatch&gt;
+    </highlight>
+    </note>
+
 </section>
 
 <section id="contentencoding"><title>Content encoding</title>