Hello,
I’m having issues to apply certain configurations in Nextcloud.
The following directives are in my .htaccess
file:
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
Header set Referrer-Policy "no-referrer"
# Block configuration files
RewriteRule ^(\.|package\.json|package-lock\.json|composer\.lock|Gruntfile\.js|Vagrantfile|Gemfile|Rakefile|.*rc)$ - [R=404,L]
# Block documentation directory
RewriteRule ^core/doc/admin(/.*)?$ - [R=404,L]
I’ve tried moving these rules into the VirtualHost
configuration instead of .htaccess
. However:
Strict-Transport-Security
header works when I usecurl
, but I still get a warning in the “overview” section of Nextcloud- The file and directory blocking does not work at all unless they are in
.htaccess
.
Unfortunately, I’m on a shared hosting server, so many of the solutions I’ve found aren’t applicable to my situation.
I really want to avoid relying on .htaccess
as I have read that there is no built-in option to prevent it from being overwritten during updates.
– operating system:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
– Apache version
Server version: Apache/2.4.62 (Debian)
Server built: 2024-07-22T12:30:55
Thanks in advance!