Month: January 2021

Apache2: Restrict access based on file extensions

The following ruleset in Apache 2.4’s vHost or server configuration allows us to only grant access to some specific file extensions. All files not covered by the following rule are not accessible via the web server: In this case, we only allow the extensions .php, .css, .js, .png, .jpg and .jpeg. This rule first prevents […]