[TASK] Migrate LiveSearch to TypeScript
[Packages/TYPO3.CMS.git] / _.htaccess
index 2ddfe42..03e8794 100644 (file)
                </IfModule>
        </IfModule>
 
                </IfModule>
        </IfModule>
 
-       # Compress all output labeled with one of the following media types
+       # Compress all output labeled with one of the following media types.
+       #
+       # (!) For Apache versions below version 2.3.7 you don't need to
+       # enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
+       # and `</IfModule>` lines as `AddOutputFilterByType` is still in
+       # the core directives.
+       #
+       # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
+
        <IfModule mod_filter.c>
        <IfModule mod_filter.c>
-               AddOutputFilterByType DEFLATE "application/atom+xml" \
-                       "application/javascript" \
-                       "application/json" \
-                       "application/ld+json" \
-                       "application/manifest+json" \
-                       "application/rdf+xml" \
-                       "application/rss+xml" \
-                       "application/schema+json" \
-                       "application/vnd.geo+json" \
-                       "application/vnd.ms-fontobject" \
-                       "application/x-font-ttf" \
-                       "application/x-javascript" \
-                       "application/x-web-app-manifest+json" \
-                       "application/xhtml+xml" \
-                       "application/xml" \
-                       "font/eot" \
-                       "font/opentype" \
-                       "image/bmp" \
-                       "image/svg+xml" \
-                       "image/vnd.microsoft.icon" \
-                       "image/x-icon" \
-                       "text/cache-manifest" \
-                       "text/css" \
-                       "text/html" \
-                       "text/javascript" \
-                       "text/plain" \
-                       "text/vcard" \
-                       "text/vnd.rim.location.xloc" \
-                       "text/vtt" \
-                       "text/x-component" \
-                       "text/x-cross-domain-policy" \
-                       "text/xml"
+               AddOutputFilterByType DEFLATE application/atom+xml \
+                       application/javascript \
+                       application/json \
+                       application/ld+json \
+                       application/manifest+json \
+                       application/rdf+xml \
+                       application/rss+xml \
+                       application/schema+json \
+                       application/vnd.geo+json \
+                       application/vnd.ms-fontobject \
+                       application/x-font-ttf \
+                       application/x-javascript \
+                       application/x-web-app-manifest+json \
+                       application/xhtml+xml \
+                       application/xml \
+                       font/eot \
+                       font/opentype \
+                       image/bmp \
+                       image/svg+xml \
+                       image/vnd.microsoft.icon \
+                       image/x-icon \
+                       text/cache-manifest \
+                       text/css \
+                       text/html \
+                       text/javascript \
+                       text/plain \
+                       text/vcard \
+                       text/vnd.rim.location.xloc \
+                       text/vtt \
+                       text/x-component \
+                       text/x-cross-domain-policy \
+                       text/xml
        </IfModule>
 
        <IfModule mod_mime.c>
        </IfModule>
 
        <IfModule mod_mime.c>
@@ -91,7 +99,7 @@
        </IfModule>
 </IfModule>
 
        </IfModule>
 </IfModule>
 
-### End: Compression via TYPO3 ###
+### End: Compression ###
 
 
 
 
 
 
 
 </IfModule>
 
 
 </IfModule>
 
-### End: Browser caching of ressource files ###
+### End: Browser caching of resource files ###
 
 
 ### Begin: MIME types ###
 
 
 ### Begin: MIME types ###
@@ -254,10 +262,8 @@ AddDefaultCharset utf-8
        # Enable URL rewriting
        RewriteEngine On
 
        # Enable URL rewriting
        RewriteEngine On
 
-       # Using mod_rewrite in .htaccess files without knowing the RewriteBase
-       RewriteBase /
-
-       # Store the current location in an environment variable CWD
+       # Store the current location in an environment variable CWD to use
+       # mod_rewrite in .htaccess files without knowing the RewriteBase
        RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
        RewriteRule ^.*$ - [E=CWD:%2]
 
        RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
        RewriteRule ^.*$ - [E=CWD:%2]
 
@@ -267,7 +273,7 @@ AddDefaultCharset utf-8
        #RewriteCond %{HTTP_HOST} ^staging\.example\.com$
        #RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging]
        #RewriteCond %{HTTP_HOST} ^www\.example\.com$
        #RewriteCond %{HTTP_HOST} ^staging\.example\.com$
        #RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging]
        #RewriteCond %{HTTP_HOST} ^www\.example\.com$
-       RewriteRule .? - [E=TYPO3_CONTEXT:Production]
+       #RewriteRule .? - [E=TYPO3_CONTEXT:Production]
 
        # Rule for versioned static files, configured through:
        # - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
 
        # Rule for versioned static files, configured through:
        # - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
@@ -275,22 +281,24 @@ AddDefaultCharset utf-8
        # IMPORTANT: This rule has to be the very first RewriteCond in order to work!
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        # IMPORTANT: This rule has to be the very first RewriteCond in order to work!
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
-       RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
+       RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ %{ENV:CWD}$1.$3 [L]
 
        # Access block for folders
        RewriteRule _(?:recycler|temp)_/ - [F]
        RewriteRule fileadmin/templates/.*\.(?:txt|ts)$ - [F]
 
        # Access block for folders
        RewriteRule _(?:recycler|temp)_/ - [F]
        RewriteRule fileadmin/templates/.*\.(?:txt|ts)$ - [F]
-       RewriteRule typo3temp/logs/ - [F]
-       RewriteRule (?:typo3conf/ext|typo3/sysext|typo3/ext|typo3/vendor)/[^/]+/(?:Configuration|Resources/Private|Tests?)/ - [F]
+       RewriteRule ^(?:vendor|typo3_src|typo3temp/var) - [F]
+       RewriteRule (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ - [F]
 
 
-       # Access block for files or folders starting with a dot
+       # Block access to all hidden files and directories with the exception of
+       # the visible content from within the `/.well-known/` hidden directory (RFC 5785).
+       RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
        RewriteCond %{SCRIPT_FILENAME} -d [OR]
        RewriteCond %{SCRIPT_FILENAME} -f
        RewriteRule (?:^|/)\. - [F]
 
        # Stop rewrite processing, if we are in the typo3/ directory or any other known directory
        # NOTE: Add your additional local storages here
        RewriteCond %{SCRIPT_FILENAME} -d [OR]
        RewriteCond %{SCRIPT_FILENAME} -f
        RewriteRule (?:^|/)\. - [F]
 
        # Stop rewrite processing, if we are in the typo3/ directory or any other known directory
        # NOTE: Add your additional local storages here
-       RewriteRule (?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
+       RewriteRule ^(?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
 
        # If the file/symlink/directory does not exist => Redirect to index.php.
        # For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
 
        # If the file/symlink/directory does not exist => Redirect to index.php.
        # For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
@@ -302,19 +310,25 @@ AddDefaultCharset utf-8
 </IfModule>
 
 # Access block for files
 </IfModule>
 
 # Access block for files
-<FilesMatch "(?i:^\.|^#.*#|^(?:ChangeLog|ToDo|Readme|License)(?:\.md|\.txt)?|^composer\.(?:json|lock)|^ext_conf_template\.txt|^ext_typoscript_constants\.txt|^ext_typoscript_setup\.txt|flexform[^.]*\.xml|locallang[^.]*\.(?:xml|xlf)|\.(?:bak|co?nf|cfg|ya?ml|ts|dist|fla|in[ci]|log|sh|sql(?:\..*)?|sw[op]|git.*)|.*(?:~|rc))$">
-       # Apache < 2.3
-       <IfModule !mod_authz_core.c>
-               Order allow,deny
-               Deny from all
-               Satisfy All
-       </IfModule>
+# Apache < 2.3
+<IfModule !mod_authz_core.c>
+    <FilesMatch "(?i:^\.|^#.*#|^(?:ChangeLog|ToDo|Readme|License)(?:\.md|\.txt)?|^composer\.(?:json|lock)|^ext_conf_template\.txt|^ext_typoscript_constants\.txt|^ext_typoscript_setup\.txt|flexform[^.]*\.xml|locallang[^.]*\.(?:xml|xlf)|\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|dist|fla|in[ci]|log|sh|sql(?:\..*)?|sw[op]|git.*)|.*(?:~|rc))$">
+        Order allow,deny
+        Deny from all
+        Satisfy All
+    </FilesMatch>
+</IfModule>
+# Apache ≥ 2.3
+<IfModule mod_authz_core.c>
+    <If "%{REQUEST_URI} =~ m#(?i:/\.|/\x23.*\x23|/(?:ChangeLog|ToDo|Readme|License)(?:\.md|\.txt)?|/composer\.(?:json|lock)|/ext_conf_template\.txt|/ext_typoscript_constants\.txt|/ext_typoscript_setup\.txt|flexform[^.]*\.xml|locallang[^.]*\.(?:xml|xlf)|\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|dist|fla|in[ci]|log|sh|sql(?:\..*)?|sw[op]|git.*)|.*(?:~|rc))$#">
+        Require all denied
+    </If>
+</IfModule>
 
 
-       # Apache ≥ 2.3
-       <IfModule mod_authz_core.c>
-               Require all denied
-       </IfModule>
-</FilesMatch>
+# Block access to vcs directories
+<IfModule mod_alias.c>
+       RedirectMatch 404 /\.(?:git|svn|hg)/
+</IfModule>
 
 ### End: Rewriting and Access ###
 
 
 ### End: Rewriting and Access ###