Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.

Commit bebb406

Browse files
bnflochmueller
authored andcommitted
[TASK] htaccess: Generate direct access protection
When the root .htaccess invokes the RewriteRule to typo3temp/tx_ncstaticfilecache/ apache performs an internal redirect where the root .htaccess is ignored since the subdirectory includes an .htaccess file that includes an own set of RewriteRules. Prevent direct access by including the access check in all .htaccess files.
1 parent f2dedc6 commit bebb406

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Resources/Private/Templates/Htaccess.html

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
<f:if condition="{sendCacheControlHeaderRedirectAfterCacheTimeout}">
88
<IfModule mod_rewrite.c>
99
RewriteEngine On
10+
11+
<f:comment>
12+
Explicitly prevent direct access here. This is needed because the .htaccess
13+
access check in the root dir is overwritten by the RewriteRules defined here.
14+
</f:comment>
15+
RewriteCond %{ENV:REDIRECT_STATUS} ^$
16+
RewriteRule .* - [F,L]
17+
1018
RewriteCond %<![CDATA[{TIME}]]> ><f:format.date format="YmdHis">@{expires}</f:format.date>
1119
RewriteRule ^.*$ /index.php
1220
</IfModule>

0 commit comments

Comments
 (0)