HTACCESS
Documentation for configuring ASF (Apache Software Foundation) Hypertext Transfer Protocol (HTTP) Server Access (HTACCESS) files.
intro
There are no characters before the period in a ".htaccess" file. HTACCESS is ideally placed into the webroot at "/.htaccess". HTACCESS is written in plaintext.
- Wikipedia: "HTACCESS"
- DreamHost Knowledge Base: "HTACCESS Overview"
- DreamHost Knowledge Base: "What Can I Do with an HTACCESS File?"
- ASF HTTP Server Project Documentation: "HTACCESS Files"
- Nicole Sharp’s Website: "HTACCESS"
redirects
- DreamHost Knowledge Base: "How Can I Redirect and Rewrite my Uniform Resource Locators (URLs) with an HTACCESS File?"
- ASF HTTP Server Project Documentation: "Alias Module"
- Wikipedia: "HTTP Status Codes"
- Mozilla Developer Network: "HTTP Response Status Codes"
- Internet Engineering Task Force (IETF) HTTP Working Group: "Internet Standard 97 (HTTP Semantics: Overview of Status Codes)"
If you want to temporarily redirect traffic to another site, use an HTTP 302 (not HTTP 301) redirect. HTTP 302 instructs searchbots to continue indexing the host domain and to check back later to see if the temporary redirect has ceased or changed.
Redirect 302 / https://nicolesharp.dreamhosters.com/ # https://httpd.apache.org/docs/current/mod/mod_alias.html#redirect # https://httpwg.org/specs/rfc9110.html#status.302
MediaWiki shortlinks
RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
# https://www.mediawiki.org/wiki/Manual:Short_URL/Apache#Setting_up_the_rewrite_rules
MEDIAWIKI files
MediaWiki source code saved as ".mediawiki" files will not display in the web browser unless you set the Multipurpose Internet Mail Extension (MIME) type for ".mediawiki" to "text/plain".
AddType text/plain .mediawiki # https://httpd.apache.org/docs/current/mod/mod_mime.html#addtype
character encoding
Unicode special characters encoded as Eight-Bit Unicode Transformation Format (UTF-8) in plaintext (.txt) and ".mediawiki" files will not display correctly in the browser unless the character set (charset) encoding is manually set for these filetypes. You should set the charset for each filetype individually and should not use "AddDefaultCharset".
AddCharset UTF-8 .mediawiki .txt # https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
automatic indexing
"FancyIndexing" must be enabled before adding icons. "IconsAreLinks" can only be enabled after the icons are added.
IndexOptions Charset=UTF-8 +FancyIndexing NameWidth=* IndexHeadInsert "<meta name=\"robots\" content=\"index, follow\"><meta name=\"audience\" content=\"all\"><meta name=\"author\" content=\"Nicole Sharp\"><meta name=\"copyright\" content=\"Copyright (C) 2026 Nicole Sharp (NicoleSharp.net)\">" DefaultIcon /images/icons/filetypes/000.svg AddIcon /images/icons/filetypes/zzz.svg ^^DIRECTORY^^ AddIcon /images/icons/filetypes/7z0.svg .7z AddIcon /images/icons/filetypes/css.svg .css AddIcon /images/icons/filetypes/htm.svg .htm .html AddIcon /images/icons/filetypes/ico.svg .ico AddIcon /images/icons/filetypes/med.svg .mediawiki AddIcon /images/icons/filetypes/png.svg .png AddIcon /images/icons/filetypes/svg.svg .svg AddIcon /images/icons/filetypes/txt.svg .txt IndexOptions +IconsAreLinks AddDescription "README" README.htm README.txt ReadmeName /footer.html # https://httpd.apache.org/docs/current/mod/mod_autoindex.html
You can use either "footer.txt" or "footer.html" to add content to the bottom of each automatically generated indexpage. "footer.html" here is not a webpage or a valid Hypertext Markup Language (HTML) document. It is just a code snippet to be inserted before the closing </body> tag. You should not have a "!DOCTYPE", an "html" element, or a "body" element in the "footer.html" file. Since this is an HTML snippet instead of an HTML page, I use ".html" instead of ".htm" for the file extension to provide a semantic indicator that this file is not to be served as a webpage.
Since this hypertext will appear frequently on many different pages, you should not use redirecting links. In the example below, this means using the full "/wiki/Creative_Commons_Attribution-ShareAlike_4.0_International_Public_License" and not the shorter "/wiki/CC_BY-SA". Avoiding wikiredirects here should reduce server load.
Remember to add a blank line at the end of "footer.html" to create a linebreak before "</body>" when the HTML is inserted. This is not necessary for "footer.txt".
HTML version
"footer.html" must be validated for HTML 3.2. "IndexOptions +FancyIndexing +XHTML" is not supported for ASF HTACCESS on DreamHost shared hosting. Use the Worldwide Web Consortium (W3C) Markup Validation Service to check for any elements or attributes not valid in HTML 3.2. Select "Validate by Direct Input" and then select "Use Doctype HTML 3.2" under "Validate Full Document".
Important differences between HTML 3.2 versus HTML 4, HTML 5, or Extensible HTML (XHTML):
- You cannot use an HTML 5 "
footer" element in the "footer.html" file. The "time" element is also not supported. - You will get an error from W3C Validator if you try to use XHTML syntax for self-closing tags in HTML 3.2. You must use "
<br>" and not "<br />". - HTML 3.2 does not officially support UTF-8 character encoding. You should not use Unicode special characters in "
footer.txt" and you should use character entities to escape special characters in "footer.html": use "©" and not "©".
HTACCESS HTML footer for Nicole Sharp’s Website.
<p>© (Copyright) 2026 <a rel="author" href="/wiki/Nicole_Sharp">Nicole Sharp</a> (<cite>NicoleSharp.net</cite>).</p> <p>Unless otherwise noted, content on this site is available under the <cite><a rel="license" href="/wiki/Creative_Commons_Attribution-ShareAlike_4.0_International_Public_License">Creative Commons Attribution-ShareAlike 4.0 International Public License</a> (CC BY-SA 4.0)</cite>.</p> <p><strong><a rel="home" href="/wiki/NikkiWiki">Return to the homepage for <cite>Nicole Sharp’s Website</cite>.</a></strong></p>
HTACCESS text footer for Nicole Sharp’s Website.
Copyright (C) 2026 Nicole Sharp. https://www.nicolesharp.net/ Unless otherwise noted, content on Nicole Sharp's Website is available under the Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 International Public License. https://www.nicolesharp.net/wiki/CC_BY-SA
error pages
- DreamHost Knowledge Base: "Custom Error Pages"
- ASF HTTP Server Project Documentation: "Custom Error Responses"
- NikkiSite: "ASF"
- NikkiWiki: "403 (Forbidden)"
- NikkiWiki: "404 (Not Found)"
- NikkiWiki: "503 (Service Unavailable)"
The default error pages for ASF HTTP Server are dead-end pages meaning there is no way to navigate back to the homepage if an error is encountered. You should set up custom error pages with a hyperlink back to the homepage to improve site navigation.
Custom error pages are best served as static Hypertext Markup Language (HTML) without redirecting to a Personal Homepage Hypertext Preprocessor (PHP) application like Wikimedia MediaWiki. This ensures that the error message will display even if PHP is not working.
You cannot customize the error pages for HTTP 400 or HTTP 500 errors on DreamHost shared webhosting.
ErrorDocument 403 /ASF/403.htm ErrorDocument 404 /ASF/404.htm # https://httpd.apache.org/docs/current/custom-error.html
sample
HTACCESS for Nicole Sharp’s Website.
RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
# https://www.mediawiki.org/wiki/Manual:Short_URL/Apache#Setting_up_the_rewrite_rules
AddType text/plain .mediawiki
AddCharset UTF-8 .mediawiki .txt
# https://httpd.apache.org/docs/current/mod/mod_mime.html
IndexOptions Charset=UTF-8 +FancyIndexing NameWidth=*
IndexHeadInsert "<meta name=\"robots\" content=\"index, follow\"><meta name=\"audience\" content=\"all\"><meta name=\"author\" content=\"Nicole Sharp\"><meta name=\"copyright\" content=\"Copyright (C) 2026 Nicole Sharp (NicoleSharp.net)\">"
DefaultIcon /images/icons/filetypes/000.svg
AddIcon /images/icons/filetypes/zzz.svg ^^DIRECTORY^^
AddIcon /images/icons/filetypes/7z0.svg .7z
AddIcon /images/icons/filetypes/css.svg .css
AddIcon /images/icons/filetypes/doc.svg .doc
AddIcon /images/icons/filetypes/dox.svg .docx
AddIcon /images/icons/filetypes/htm.svg .htm .html
AddIcon /images/icons/filetypes/ico.svg .ico
AddIcon /images/icons/filetypes/jpg.svg .jpg .jpeg
AddIcon /images/icons/filetypes/med.svg .mediawiki
AddIcon /images/icons/filetypes/mht.svg .mht .mhtml
AddIcon /images/icons/filetypes/ods.svg .ods
AddIcon /images/icons/filetypes/odt.svg .odt
AddIcon /images/icons/filetypes/oxp.svg .oxps
AddIcon /images/icons/filetypes/pdf.svg .pdf
AddIcon /images/icons/filetypes/png.svg .png
AddIcon /images/icons/filetypes/svg.svg .svg
AddIcon /images/icons/filetypes/txt.svg .txt
AddIcon /images/icons/filetypes/xht.svg .xht .xhtml
AddIcon /images/icons/filetypes/xls.svg .xls
AddIcon /images/icons/filetypes/xlx.svg .xlsx
AddIcon /images/icons/filetypes/xml.svg .xml
AddIcon /images/icons/filetypes/xps.svg .xps
AddIcon /images/icons/filetypes/zip.svg .zip
IndexOptions +IconsAreLinks
AddDescription "README" README.htm README.txt
ReadmeName /footer.html
# https://httpd.apache.org/docs/current/mod/mod_autoindex.html
ErrorDocument 403 /ASF/403.htm
ErrorDocument 404 /ASF/404.htm
ErrorDocument 503 /ASF/503.htm
# https://httpd.apache.org/docs/current/custom-error.html
# ASF Hypertext Transfer Protocol Server Access (HTACCESS) for Nicole Sharp's Website: https://www.nicolesharp.net/
# Copyright (C) 2026-04-20 Nicole Sharp
# Content in this file is available under the Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 International Public License: https://www.nicolesharp.net/wiki/CC_BY-SA
# Please read the following statements from Natives in Tech and ASF (Apache Software Foundation) regarding use of the name "Apache":
# https://web.archive.org/web/20241117093851/https://blog.nativesintech.org/apache-appropriation/
# https://news.apache.org/foundation/entry/evolving-the-asf-brand/
# https://news.apache.org/foundation/entry/introducing-the-asfs-new-logo/