Code and config

.htaccess viewer

Drop a .htaccess file to see each directive explained, its rewrite rules and redirects, and anything Apache would read differently than you meant. Your browser opens it on your device: nothing is uploaded.

Opened on this device, never uploadedDrop or paste another file at any time

What you see

.htaccess in the viewerWhat it does
Directives explainedRewrite, Redirect, ErrorDocument, Options, Header, Require and more, with Apache’s defaults
CheckedSections never closed or closed in the wrong order, a # comment after a directive, Options Indexes
NameOpened by its name, with no extension
Extensions.conf, .cnf, .ovpn
UploadNone: opened on your device

What is a .htaccess file?

In short

A .htaccess file holds Apache settings for one folder of a website: redirects, rewrite rules, error pages, who may see what. Apache reads it on every request; the dot at the start hides it on Mac and Linux.

How to open a .htaccess file

  1. Add your .htaccess. Drop the file in the box, choose it or paste it.
  2. Look at it. The file colored, with what each directive means and a link to Apache’s docs under it when you switch Explanations on, and mistakes such as a section never closed or a # after a directive, which Apache doesn’t read as a comment.

Questions

How do I open a .htaccess file?

Drop it here, or open it in a text editor. On a Mac or Linux it is hidden because its name starts with a dot: show hidden files (Cmd + Shift + . on a Mac) to pick it.

Why is my .htaccess ignored?

Apache only reads it where AllowOverride lets it, set in the server’s own config; AllowOverride None, the default, ignores it.

Can I put a comment after a directive?

No. Apache comments go on a line of their own starting with #; after a directive the # is read as part of the value.

Is my file uploaded?

No. The viewer runs in your browser and opens the file on your device. Nothing is sent anywhere.

Can opening a file here damage it?

No. The viewer only reads the file: a browser gives a page no way to change it. If something goes wrong, the view stops and the file is as it was.

Related