Back to the blog
hostinghtaccesstechniek

The .htaccess file explained

A small configuration file that handles redirects, security and access rules. Powerful, and easy to break.

What it is for

Redirecting addresses, forcing https, password-protecting folders, blocking file types, and setting browser caching.

Order matters

Rules are read top to bottom. A general rule placed too high can stop everything below it from applying. That is the most common cause of "the redirect does not work".

One mistake breaks the whole site

Unlike application code, a syntax error here gives a 500 across the entire site, including the admin area. So you can no longer fix it through the browser.

How to work carefully

Make a copy before every change. Test immediately after saving, and keep your file access open so you can undo it.

What does not belong in it

Hundreds of individual redirects. Past a certain volume it slows every request — handle those in your application instead.

#htaccess#htaccess redirect#force https
Trust Guard Security Scanned
Call us
Send an email