mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
19c4d39a67
- prevent accessing app folders (like app, assests, js...) - prevent using the /index.php in the URL - removes the need of RewriteBase in case HumHub is installed on a sub-folder
23 lines
675 B
Plaintext
23 lines
675 B
Plaintext
# check if RewriteModule is availbale
|
|
<IfModule mod_rewrite.c>
|
|
|
|
# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.) - except let's encrypt challenge
|
|
RedirectMatch 403 ^/?\.(?!/well-known/acme-challenge/[\w-]{43}$)
|
|
|
|
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
|
|
RewriteRule ^(.*) - [E=BASE:%1]
|
|
|
|
# Sets the HTTP_AUTHORIZATION header removed by apache
|
|
RewriteCond %{HTTP:Authorization} .
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
|
|
RewriteCond %{ENV:REDIRECT_STATUS} ^$
|
|
RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
|
|
|
|
RewriteCond %{REQUEST_FILENAME} -f
|
|
RewriteRule .? - [L]
|
|
|
|
RewriteRule .? %{ENV:BASE}/index.php [L]
|
|
|
|
</IfModule>
|