From c23204bc62a725233d426c28036ee0746eaa1553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Thu, 13 Jun 2019 10:23:17 +0200 Subject: [PATCH] Update .htaccess files --- .htaccess_prod | 178 ++++++++++++++++++++++++++++++----------------- public/.htaccess | 169 ++++++-------------------------------------- 2 files changed, 136 insertions(+), 211 deletions(-) diff --git a/.htaccess_prod b/.htaccess_prod index 029fa2d6..3edeb0a6 100644 --- a/.htaccess_prod +++ b/.htaccess_prod @@ -1,11 +1,11 @@ -Order Deny,Allow -Deny from 195.66.157.234 -Deny from 148.251.50.77 -Deny from 46.4.83.150 -Deny from 46.245.132.179 -Deny from 169.149.213.31 +### Begin: Compression ### -SetEnv TYPO3_CONTEXT "Production" +# Compressing resource files will save bandwidth and so improve loading speed especially for users +# with slower internet connections. TYPO3 can compress the .js and .css files for you. +# *) Uncomment the following lines and +# *) Set $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'] = 9 for the Backend +# *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties +# config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files. AddType "text/javascript" .gzip @@ -24,6 +24,15 @@ AddEncoding gzip .gzip + # 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 `` + # and `` lines as `AddOutputFilterByType` is still in + # the core directives. + # + # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype + AddOutputFilterByType DEFLATE application/atom+xml \ application/javascript \ @@ -60,10 +69,17 @@ AddEncoding gzip .gzip - AddEncoding gzip svgz + AddEncoding gzip svgz +### End: Compression ### + + + +### Begin: Browser caching of resource files ### + +# This affects Frontend and Backend and increases performance. ExpiresActive on @@ -121,6 +137,12 @@ AddEncoding gzip .gzip +### End: Browser caching of resource files ### + + +### Begin: MIME types ### + +# Proper MIME types for all files # Data interchange @@ -172,34 +194,46 @@ AddEncoding gzip .gzip +# UTF-8 encoding AddDefaultCharset utf-8 AddCharset utf-8 .atom .css .js .json .manifest .rdf .rss .vtt .webapp .webmanifest .xml +### End: MIME types ### + + + +### Begin: Cross Origin ### + +# Send the CORS header for images when browsers request it. - SetEnvIf Origin ":" IS_CORS - Header set Access-Control-Allow-Origin "*" env=IS_CORS + + SetEnvIf Origin ":" IS_CORS + Header set Access-Control-Allow-Origin "*" env=IS_CORS + -# -# -# -# SetEnvIf Origin ":" IS_CORS -# Header set Access-Control-Allow-Origin "*" env=IS_CORS -# -# -# -# -# -# -# Header set Access-Control-Allow-Origin "*" -# -# +# Allow cross-origin access to web fonts. + + + Header set Access-Control-Allow-Origin "*" + + + +### End: Cross Origin ### + + + +### Begin: Rewriting and Access ### + +# You need rewriting, if you use a URL-Rewriting extension (RealURL, CoolUri). + + # Enable URL rewriting RewriteEngine On # Begin ep-events.de redirects @@ -895,7 +929,6 @@ AddDefaultCharset utf-8 RewriteCond %{HTTP_HOST} ^(www\.)?ski\-wochenenden\.de [NC] RewriteCond %{QUERY_STRING} ^tx_epproducts_product_detail RewriteRule ^(.*)$ https://www.ski-wochenenden.de/$1? [L,R=302,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ski\-wochenenden\.de [NC] RewriteRule ^(.*)/product/(.*)$ https://www.ski-wochenenden.de/$1? [L,R=301,NC] RewriteCond %{HTTP_HOST} ^www\.ski\-wochenenden\.de [NC] @@ -959,38 +992,27 @@ AddDefaultCharset utf-8 # Begin ep-reisen redirects RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^sites/default/files/ - [L,R=410,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule php3$ - [L,R=410,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^internet/privat - [L,R=410,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteCond %{QUERY_STRING} ^(quicktabs|reise) RewriteRule ^(.*)$ https://www.ep-reisen.de/? [L,R=301,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule , https://www.ep-reisen.de/? [L,R=301,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule reise_\d+\.htm$ https://www.ep-reisen.de/? [L,R=301,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^sites/default/files/ - [L,R=410,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^(.*)/www.ski-wochenenden.de/index.php https://www.ep-reisen.de/$1? [L,R=301,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^ajax/search/pricetable/json/(.*)$ https://www.ep-reisen.de/ajax/table/pricetable/json/$1 [L,R=301,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^(.*)/product/(.*)$ https://www.ep-reisen.de/$1? [L,R=301,NC] - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^skireisen/reiseziele/frankreich/les-deux-alpes/unichamp-eventreise/product/unichamp/lours-blanc/485/www.ski-wochenenden.de/index.php https://www.ep-reisen.de/skireisen/reiseziele/frankreich/les-deux-alpes/unichamp-eventreise/detail/5/45/? [L,R=301,NC] - RedirectMatch 301 ^/www.ep-reisen.de https://www.ep-reisen.de/ RedirectMatch 301 ^/infos/anreise/ep-skibus/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/infos/reiseinfos/ski-busreisen/$1 RedirectMatch 301 ^/infos/leihmaterial/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/infos/reiseinfos/skiausruestung-leihen/$1 @@ -1004,11 +1026,9 @@ AddDefaultCharset utf-8 RedirectMatch 301 ^/reiseinfos/skipaesse/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/infos/reiseinfos/skiurlaub-mit-skipass/$1 RedirectMatch 301 ^/reisen-fuer-gruppen/fuer-privatgruppen/ski-family/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/reisen-fuer-gruppen/skireisen-fuer-gruppen/gruppen-skifreizeit/familien/$1 RedirectMatch 301 ^/reisen-fuer-gruppen/selbstversorger-haeuser-im-sommer/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/reisen-fuer-gruppen/gruppenhaeuser/$1 - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^reiseziele/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/reiseziele/$1 [L,R=301,NC] #RedirectMatch 301 ^/reiseziele/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/reiseziele/$1 - RedirectMatch 301 ^/reiseziele/winter/frankreich/3-vallees-val-thorens/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/reiseziele/frankreich/trois-vallees/val-thorens/$1 RedirectMatch 301 ^/reiseziele/winter/frankreich/3-vallees-val-thorens/val-thorens/les-montagnettes-ski-boarderweek/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/reiseziele/frankreich/trois-vallees/ski-boarderweek-eventreise/$1 RedirectMatch 301 ^/reiseziele/winter/frankreich/les-deux-alpes/les-deux-alpes/appartements-village-les-deux-alpes/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/reiseziele/frankreich/les-deux-alpes/$1 @@ -1095,12 +1115,9 @@ AddDefaultCharset utf-8 RedirectMatch 301 ^/infos/schneehoehen-aktuell/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/infos/allgemeine-infos/schneehoehen/$1$2 RedirectMatch 301 ^/jobs-praktika-bei-ep/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/karriere-job-reisen/$1$2 RedirectMatch 301 ^/jobs-praktika-bei-ep/bewerbungsformular-saisonteamer-1617/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/karriere-job-reisen/jobs-in-den-bergen/saisonteamer-winter/bewerbungsformular-$2saisonteamer-winter/$1 - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^kontakt https://www.ep-reisen.de/skireisen/unternehmen/kontakt/$1 [L,R=301,NC] - #RedirectMatch 301 ^/kontakt/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/kontakt/$1$2 - RedirectMatch 301 ^/mayrhofen-gaestehaus-kroell-fewopension/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/reiseziele/oesterreich/zillertal/ferienwohnungen-kroell/$1$2 RedirectMatch 301 ^/merkzettel/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/$1$2 RedirectMatch 301 ^/newsletter-anmeldung/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/kontakt/katalog-newsletter/$1$2 @@ -1128,10 +1145,8 @@ AddDefaultCharset utf-8 RedirectMatch 301 ^/node/67/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/reiseziele/oesterreich/zillertal/mayrhofen/$1$2 RedirectMatch 301 ^/node/74/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/infos/reiseinfos/skiurlaub-mit-skipass/$1$2 RedirectMatch 301 ^/node/87/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/reiseziele/schweiz/davos-klosters/sportclub-schweizerhaus/$1$2 - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^node https://www.ep-reisen.de/? [L,R=301,NC] - RedirectMatch 301 ^/officeteam/boris-engelhardt/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/ueber-ep-skireise-veranstalter/mitarbeiter-reiseveranstalter-koeln/$1$2 RedirectMatch 301 ^/officeteam/christiane-ringe/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/ueber-ep-skireise-veranstalter/mitarbeiter-reiseveranstalter-koeln/$1$2 RedirectMatch 301 ^/officeteam/christian-reske/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/unternehmen/ueber-ep-skireise-veranstalter/mitarbeiter-reiseveranstalter-koeln/$1$2 @@ -2038,17 +2053,13 @@ AddDefaultCharset utf-8 RedirectMatch 301 ^/wochenenden-kurztrips-wwwski-wochenendende/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/reisekonzepte/skiwochenenden/$1$2 RedirectMatch 301 ^/reiseziele/winter/schweiz/4-vallees-verbier/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/reiseziele/schweiz/4-vallees/$1$2 RedirectMatch 301 ^/Zugfahrt/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?(\?gclid=[a-zA-Z0-9_]+)?$ https://www.ep-reisen.de/skireisen/infos/reiseinfos/ski-busreisen/$1$2 - RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.de [NC] RewriteRule ^davos/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ https://www.ep-reisen.de/skireisen/reiseziele/schweiz/davos-klosters/ [L,R=301,NC] - # end ep-reisen redirects # Begin snowzone redirects - RewriteCond %{HTTP_HOST} ^(www\.)?snowzone\.net [NC] RewriteRule ^programm/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ http://www.snowzone.net/les-deux-alpes/programm/$1 - #RedirectMatch 301 ^/davos http://www.snowzone.net/ RedirectMatch 301 ^/home/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ http://www.snowzone.net/$1 RedirectMatch 301 ^/les-deux-alpes/location/ort/ort-les-deux-alpes/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ http://www.snowzone.net/les-deux-alpes/location/ort/les-deux-alpes/$1 @@ -2230,7 +2241,6 @@ AddDefaultCharset utf-8 RedirectMatch 301 ^/deux-alpes/unterkunft/centre-muzelle/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ http://www.snowzone.net/les-deux-alpes/reise/unterkuenfte/$1 RedirectMatch 301 ^/deux-alpes/unterkunft/centre-bel-alp/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ http://www.snowzone.net/les-deux-alpes/reise/unterkuenfte/$1 RedirectMatch 301 ^/les-deux-alpes/reise/zusatzleistungen/anreise/?([a-z]{4}[0-9]{4}[a-zA-Z0-9]*)?$ http://www.snowzone.net/les-deux-alpes/reise/reiseinfos/anreise/$1 - RewriteCond %{HTTP_HOST} ^www\.snowzone\.net [NC] RewriteRule ^reise/zusatzleistungen/skikurs/ https://www.snowzone.net/les-deux-alpes/reise/zusatzleistungen/skifahren-lernen/ [L,R=301,NC] RewriteCond %{HTTP_HOST} ^www\.snowzone\.net [NC] @@ -2873,66 +2883,110 @@ AddDefaultCharset utf-8 RewriteRule (.*) https://www.ep-reisen.de/ [R=301,L] # End redirect catchall subdomains - # Begin force https + # Force SSL for all domains RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] - # End force https - # Begin TYPO3 default rules + # 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] + + # Rules to set ApplicationContext based on hostname + #RewriteCond %{HTTP_HOST} ^dev\.example\.com$ + #RewriteRule .? - [E=TYPO3_CONTEXT:Development] + #RewriteCond %{HTTP_HOST} ^staging\.example\.com$ + #RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging] + #RewriteCond %{HTTP_HOST} ^www\.example\.com$ + #RewriteRule .? - [E=TYPO3_CONTEXT:Production] + + # Rule for versioned static files, configured through: + # - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename'] + # - $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] + # 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] - RewriteRule typo3temp/logs/ - [F] - RewriteRule ^(vendor|typo3_src) - [F] + RewriteRule ^(?:vendor|typo3_src|typo3temp/var) - [F] RewriteRule (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ - [F] + + # 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] - RewriteRule (?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L] + + # 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] + + # 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}'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L] + - - +# Access block for files +# Apache < 2.3 + + Order allow,deny Deny from all Satisfy All - - - + + +# Apache ≥ 2.3 + + Require all denied - - + + +# Block access to vcs directories RedirectMatch 404 /\.(?:git|svn|hg)/ +### End: Rewriting and Access ### + + + +### Begin: Miscellaneous ### + +# 404 error prevention for non-existing redirected folders Options -MultiViews +# Make sure that directory listings are disabled. Options -Indexes + # Force IE to render pages in the highest available mode Header set X-UA-Compatible "IE=edge" Header unset X-UA-Compatible + # Reducing MIME type security risks Header set X-Content-Type-Options "nosniff" +# ETag removal Header unset ETag FileETag None +### End: Miscellaneous ### + + +# Add your own rules here. diff --git a/public/.htaccess b/public/.htaccess index 50fed061..a02f677e 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,31 +1,3 @@ -SetEnv TYPO3_CONTEXT "Development" - -##### -# -# Example .htaccess file for TYPO3 CMS - for use with Apache Webserver -# -# This file includes settings for the following configuration options: -# -# - Compression -# - Caching -# - MIME types -# - Cross Origin requests -# - Rewriting and Access -# - Miscellaneous -# - PHP optimisation -# -# If you want to use it, you have to copy it to the root folder of your TYPO3 installation (if its -# not there already) and rename it to '.htaccess'. To make .htaccess files work, you might need to -# adjust the 'AllowOverride' directive in your Apache configuration file. -# -# IMPORTANT: You may need to change this file depending on your TYPO3 installation! -# Consider adding this file's content to your webserver's configuration directly for speed improvement -# -# Lots of the options are taken from https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess -# -#### - - ### Begin: Compression ### # Compressing resource files will save bandwidth and so improve loading speed especially for users @@ -35,13 +7,13 @@ SetEnv TYPO3_CONTEXT "Development" # *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties # config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files. -# -# AddType "text/javascript" .gzip -# -# -# AddType "text/css" .gzip -# -#AddEncoding gzip .gzip + + AddType "text/javascript" .gzip + + + AddType "text/css" .gzip + +AddEncoding gzip .gzip # Force compression for mangled `Accept-Encoding` request headers @@ -97,7 +69,7 @@ SetEnv TYPO3_CONTEXT "Development" - AddEncoding gzip svgz + AddEncoding gzip svgz @@ -264,6 +236,7 @@ AddDefaultCharset utf-8 # Enable URL rewriting RewriteEngine On + # Force SSL for all domains RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] @@ -291,7 +264,7 @@ AddDefaultCharset utf-8 # Access block for folders RewriteRule _(?:recycler|temp)_/ - [F] RewriteRule fileadmin/templates/.*\.(?:txt|ts)$ - [F] - RewriteRule ^(?:vendor|typo3_src|typo3temp/logs) - [F] + RewriteRule ^(?:vendor|typo3_src|typo3temp/var) - [F] RewriteRule (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ - [F] # Block access to all hidden files and directories with the exception of @@ -305,109 +278,6 @@ AddDefaultCharset utf-8 # NOTE: Add your additional local storages here RewriteRule ^(?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L] - ### Begin: Static File Cache (preparation) #### - - # Document root configuration - RewriteRule .* - [E=SFC_ROOT:%{DOCUMENT_ROOT}] - # RewriteRule .* - [E=SFC_ROOT:%{DOCUMENT_ROOT}/t3site] # Example if your installation is installed in a directory - - # Cleanup URI - RewriteCond %{REQUEST_URI} ^.*$ - RewriteRule .* - [E=SFC_URI:/%{REQUEST_URI}] - RewriteCond %{REQUEST_URI} ^/.*$ - RewriteRule .* - [E=SFC_URI:%{REQUEST_URI}] - RewriteCond %{REQUEST_URI} ^/?$ - RewriteRule .* - [E=SFC_URI:/] - - # Cleanup HOST - RewriteCond %{HTTP_HOST} ^([^:]+)(:[0-9]+)?$ - RewriteRule .* - [E=SFC_HOST:%1] - - # Get scheme - RewriteCond %{SERVER_PORT} ^443$ [OR] - RewriteCond %{HTTP:X-Forwarded-Proto} https - RewriteRule .* - [E=SFC_PROTOCOL:https] - RewriteCond %{SERVER_PORT} !^443$ - RewriteCond %{HTTP:X-Forwarded-Proto} !https - RewriteRule .* - [E=SFC_PROTOCOL:http] - - # Get port (not used at the moment) - RewriteRule .* - [E=SFC_PORT:80] - RewriteCond %{SERVER_PORT} ^[0-9]*$ [OR] - RewriteRule .* - [E=SFC_PORT:%{SERVER_PORT}] - - # Check if the requested file exists in the cache, otherwise default to index.html that - # set in an environment variable that is used later on - RewriteCond %{ENV:SFC_ROOT}/typo3temp/tx_staticfilecache/%{ENV:SFC_PROTOCOL}/%{ENV:SFC_HOST}%{ENV:SFC_URI} !-f - RewriteRule .* - [E=SFC_FILE:index.html] - - # Note: https://github.com/lochmueller/staticfilecache/pull/90 (Please check the realurl configuration related to "appendMissingSlash". Perhaps you need an additional "/" in the rule above) - # RewriteRule .* - [E=SFC_FILE:/index.html] - - # Set gzip extension into an environment variable if the visitors browser can handle gzipped content and the gz-file exists - RewriteRule .* - [E=SFC_GZIP:] - RewriteCond %{HTTP:Accept-Encoding} gzip [NC] - RewriteRule .* - [E=SFC_GZIP:.gz] - RewriteCond %{ENV:SFC_ROOT}/typo3temp/tx_staticfilecache/%{ENV:SFC_PROTOCOL}/%{ENV:SFC_HOST}%{ENV:SFC_URI}%{ENV:SFC_FILE}%{ENV:SFC_GZIP} !-f - RewriteRule .* - [E=SFC_GZIP:] - - # Note: We cannot check realurl "appendMissingSlash" or other BE related settings here - in front of the delivery. - # Perhaps you have to check the "SFC_FILE" value and set it to your related configution e.g. "index.html" (without leading slash). - # More information at: https://github.com/lochmueller/staticfilecache/pull/28 - - ### Begin: Static File Cache (main) #### - - # We only redirect URI's without query strings - RewriteCond %{QUERY_STRING} ^$ - - # It only makes sense to do the other checks if a static file actually exists. - RewriteCond %{ENV:SFC_ROOT}/typo3temp/tx_staticfilecache/%{ENV:SFC_PROTOCOL}/%{ENV:SFC_HOST}%{ENV:SFC_URI}%{ENV:SFC_FILE}%{ENV:SFC_GZIP} -f - - # NO frontend or backend user is logged in. Logged in users may see different - # information than anonymous users. But the anonymous version is cached. So - # don't show the anonymous version to logged in users. - RewriteCond %{HTTP_COOKIE} !staticfilecache [NC] - - # Uncomment the following line if you use MnoGoSearch - #RewriteCond %{HTTP:X-TYPO3-mnogosearch} ^$ - - # We only redirect GET requests - RewriteCond %{REQUEST_METHOD} GET - - # Rewrite the request to the static file. - RewriteRule .* %{ENV:SFC_ROOT}/typo3temp/tx_staticfilecache/%{ENV:SFC_PROTOCOL}/%{ENV:SFC_HOST}%{ENV:SFC_URI}%{ENV:SFC_FILE}%{ENV:SFC_GZIP} [L] - - # Do not allow direct call the cache entries - RewriteCond %{ENV:SFC_URI} ^/typo3temp/tx_staticfilecache/.* - RewriteCond %{ENV:REDIRECT_STATUS} ^$ - RewriteRule .* - [F,L] - - ### Begin: Static File Cache (options) #### - - # Set proper content type and encoding for gzipped html. - - - Header set Content-Encoding gzip - - - - # if there are same problems with ForceType, please try the AddType alternative - # Set proper content type gzipped html - - ForceType text/html - # AddType "text/html" .gz - - - ForceType text/xml - # AddType "text/xml" .gz - - - ForceType text/xml - # AddType "text/xml" .gz - - - ### End: Static File Cache ### - # 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}'. RewriteCond %{REQUEST_FILENAME} !-f @@ -418,19 +288,20 @@ AddDefaultCharset utf-8 # Access block for files - - # Apache < 2.3 - +# Apache < 2.3 + + Order allow,deny Deny from all Satisfy All - - - # Apache ≥ 2.3 - + + +# Apache ≥ 2.3 + + Require all denied - - + + # Block access to vcs directories