About .htaccess

Browsing the docs here you will find lot's of reference to a mysterious invisible file called ".htaccess". What's that about? How can you make use of it?

.htaccess is a hidden file that usually lives in the web root folder of your code base. It enables altering the web server's configuration directives. .htaccess rules apply to all subdirectories. .htaccess is usually not excluded in .gitignore so it will be deployed alongside your code. Take care: htaccess is a sharp sword. With great power comes great responsibility.

.htaccess on fortrabbit

Your fortrabbit Apps are running on the Apache web server. You can make use of .htaccess. Missing (remember it's hidden) and wrong htaccess directives are common issues. These sensitive defaults are set on the fortrabbit platform regarding .htaccess:

  • Apache configuration syntax 2.2 and 2.4 are supported
  • GZIP compression is enabled per default for text based content types
  • Access on all .ht* files is disabled, so nobody can read your .htaccess

.htaccess and your framework or CMS

When you are using a framework or a CMS, chances are high, that you don't need to wrangle with .htaccess at all, as that comes built-in. Here are the most used ones:

htaccess topics

Browse our .htaccess section for examples on how to do redirects (https and domain), secure your WordPress, how to control HTTP headers and more.

Further reading

Craft CMS

Install guides

Code access

Deployment

Git

SSH

SFTP

Troubleshooting

DNS

MySQL

TLS (SSL)

htaccess

Development

Teamwork

Platform

Billing

The Dashboard

Stacks

Tips & tricks

Quirks

Support

FAQ

Need individual help?
Learn about Company plans ›
Looking for an old article?
See the full list of articles ›
Found an error?
Contribute on GitHub ›