humhub/.htaccess.dist

45 lines
1.6 KiB
Plaintext
Raw Normal View History

# check if RewriteModule is availbale
<IfModule mod_rewrite.c>
2021-12-09 15:01:04 +01:00
Options +FollowSymLinks
2021-07-26 14:38:16 +02:00
2018-05-04 00:55:37 +02:00
RewriteEngine on
2017-08-19 13:58:24 +02:00
2018-05-04 00:55:37 +02:00
# uncomment if you've installed HumHub into a subdirectory relative to your webroot & adjust RewriteBase to match the install point
#RewriteBase /humhub
2018-05-04 00:55:37 +02:00
# uncomment to force https requests
#RewriteCond %{HTTPS} !=on
#RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ [NC]
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
2018-05-04 00:55:37 +02:00
# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.) - except let's encrypt challenge
RedirectMatch 403 ^/?\.(?!well-known/acme-challenge/[\w-]{43}$)
2014-02-10 06:36:00 +01:00
2018-05-04 00:55:37 +02:00
# ensure permalink when url rewriting was enabled (index.php?r=content/perma&id=6 => /content/perma/?id=6
RewriteCond %{QUERY_STRING} ^r=content(/|%2)perma&id=([0-9]*)$
RewriteRule ^index\.php$ %{REQUEST_URI}/content/perma/?id=%2 [R=302,L]
2014-02-10 06:36:00 +01:00
2018-05-04 00:55:37 +02:00
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
2018-05-04 00:55:37 +02:00
# Sets the HTTP_AUTHORIZATION header removed by apache
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
2018-05-04 00:55:37 +02:00
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
2018-05-04 00:55:37 +02:00
RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule>
# Config files from vendor should not be readable via browser
2018-05-04 00:55:37 +02:00
<FilesMatch "^(\.|composer\.(json|lock|phar)$)">
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Order deny,allow
Deny from all
</IfModule>
</FilesMatch>