Merge pull request #1630 from ArthurHoaro/fix/apache-config
Reviewed Apache configuration
This commit is contained in:
commit
7e78237fc9
2 changed files with 13 additions and 8 deletions
|
@ -13,7 +13,7 @@ RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
|
|||
# Alternative (if the 2 lines above don't work)
|
||||
# SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
|
||||
|
||||
# REST API
|
||||
# Slim URL Redirection
|
||||
# Ionos Hosting needs RewriteBase /
|
||||
# RewriteBase /
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
|
|
|
@ -193,19 +193,24 @@ sudo nano /etc/apache2/sites-available/shaarli.mydomain.org.conf
|
|||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<LocationMatch "/\.">
|
||||
# Prevent accessing dotfiles
|
||||
RedirectMatch 404 ".*"
|
||||
</LocationMatch>
|
||||
# BE CAREFUL: directives order matter!
|
||||
|
||||
<LocationMatch "\.(?:ico|css|js|gif|jpe?g|png)$">
|
||||
<FilesMatch ".*\.(?!(ico|css|js|gif|jpe?g|png|ttf|oet|woff2?)$)[^\.]*$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
|
||||
<Files "index.php">
|
||||
Require all granted
|
||||
</Files>
|
||||
|
||||
<FilesMatch "\.(?:ico|css|js|gif|jpe?g|png|ttf|oet|woff2)$">
|
||||
# allow client-side caching of static files
|
||||
Header set Cache-Control "max-age=2628000, public, must-revalidate, proxy-revalidate"
|
||||
</LocationMatch>
|
||||
</FilesMatch>
|
||||
|
||||
|
||||
# serve the Shaarli favicon from its custom location
|
||||
Alias favicon.ico /var/www/shaarli.mydomain.org/images/favicon.ico
|
||||
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue