diff options
author | Adam Spragg <adam@spra.gg> | 2018-06-19 16:35:15 +0100 |
---|---|---|
committer | Adam Spragg <adam@spra.gg> | 2018-06-19 16:35:15 +0100 |
commit | 2f5472519016b3092dea07d6f041b1cb74c3cd13 (patch) | |
tree | 404cf9eef936a67e91b5dc1a6a066fd5f336d366 /apache2.conf | |
parent | 65c5c4043fe05ed4d94f3530c405363d3aee541c (diff) |
Output the page head/header/footer with PHP
Allows putting all the repeated stuff in one place (DRY!), so that if it
needs changing it only needs to change once.
Start the name of the included file with "@", and disallow the retrieval
of files beginning with "@" (returning 404) so that it can't be
downloaded, because it won't output anything meaningful.
Why "@"? Because it's about the only ASCII punctuation character that
doesn't mean anything special to most shells (bash), or programs, and is
therefore easy to use as a filename on the command line. I almost went
with "+", but it turns out that nvim treats arguments beginning with "+"
as options. So "@" it is.
Diffstat (limited to 'apache2.conf')
-rw-r--r-- | apache2.conf | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apache2.conf b/apache2.conf index fdf764a..7408ee8 100644 --- a/apache2.conf +++ b/apache2.conf @@ -157,6 +157,10 @@ RewriteCond %{LA-U:REQUEST_FILENAME} !-d RewriteRule !\. - [H=application/x-httpd-php] + # Disallow access to files/directories whose names begin with "@", returning a 404. + # This makes those files appear to not exist. + RewriteRule "/@" "-" [R=404,L] + <Location /obs> AuthType Basic AuthName "Private area" |