# Enable URL rewriting RewriteEngine On # To assist in debugging rewriting, you could use these lines # DON'T enable it for production! # This will only work in httpd.conf, not in .htaccess files #RewriteLog /var/log/httpd/typo3-rewrite.log #RewriteLogLevel 4 # If you use the RealUrl extension, then you'll have to enable the next line. # You will have to change this path if your TYPO3 installation is located # in a subdirectory of the website root. # # If you place this in httpd.conf, you cannot use this directive in any case! RewriteBase / ################################# ### TYPO3 Backend Performance ### ################################# AddType "text/javascript" .gzip AddType "text/css" .gzip AddEncoding gzip .gzip ############################ ### Performance Settings ### ############################ # Removal of ETag (saves some bytes; the last modified header is still there) FileETag MTime Size FileETag none # Client Caching of JS/CSS files (because they are merged with an applied hash!) ExpiresActive on ExpiresDefault "access plus 1 year" Header append Cache-Control "public" # Client Caching of sprites (they have an unique hash applied as prefix!) ExpiresActive on ExpiresDefault "access plus 1 year" Header append Cache-Control "public" # Header for compressed css and javascript contents Header set Content-Encoding gzip # deliver the uncompressed file if the gzip encoding isn't accepted RewriteCond %{HTTP:accept-encoding} !gzip [NC] RewriteRule ^typo3temp/scriptmerger/compressed/(.+)\.gz\.(js|css) typo3temp/scriptmerger/uncompressed/$1.$2 [L,NC] #################### ### TYPO3 Part I ### #################### # Don't rewrite static resources, but not for the country selection page RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -l RewriteCond %{REQUEST_URI} !^/$ RewriteRule .* - [L] ################# ### Redirects ### ################# ############################## ### EXT:nc_staticfilecache ### ############################## # Set gzip extension into an environment variable if the visitors browser can handle gzipped content. RewriteCond %{HTTP:Accept-Encoding} gzip [NC] RewriteRule .* - [E=TX_NCSTATICFILECACHE_GZIP:.gz] # 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 %{DOCUMENT_ROOT}/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI} !-f RewriteRule .* - [E=TX_NCSTATICFILECACHE_FILE:index.html] # Don't cache HTTPS traffic. You may choose to comment out this # option if your site runs fully on https. If your site runs mixed, you will # not want https traffic to be cached in the same typo3temp folder where it can # be requested over http. # Enable this if you use a mixed setup. RewriteCond %{HTTPS} off # 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 %{DOCUMENT_ROOT}/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI}%{ENV:TX_NCSTATICFILECACHE_FILE}%{ENV:TX_NCSTATICFILECACHE_GZIP} -f # NO frontend user is logged in. Logged in frontend users may see different # information than anonymous users. But the anonymous version is cached. So # don't show the anonymous version to logged in frontend users. RewriteCond %{HTTP_COOKIE} !nc_staticfilecache [NC] # We only redirect GET requests RewriteCond %{REQUEST_METHOD} GET # NO backend user is logged in. Please note that the be_typo_user cookie expires at the # end of the browser session. If you have logged out of the TYPO3 backend and are expecting to see cached pages but don't. Please close this browser settion first or remove the cookie manually or use another browser to hit your frontend. RewriteCond %{HTTP_COOKIE} !be_typo_user [NC] # mnogosearch #RewriteCond %{HTTP:X-TYPO3-mnogosearch} ^$ # Check for Ctrl Shift reload RewriteCond %{HTTP:Pragma} !no-cache RewriteCond %{HTTP:Cache-Control} !no-cache # Rewrite the request to the static file. RewriteRule .* typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI}%{ENV:TX_NCSTATICFILECACHE_FILE}%{ENV:TX_NCSTATICFILECACHE_GZIP} [L] # set proper content encoding information for gzipped files Header set Content-Encoding gzip # Set proper content type gzipped html ForceType text/html # Set proper content type gzipped xml and rss feeds ForceType text/xml ##################### ### TYPO3 Part II ### ##################### # Main URL rewriting. # If you use Windows and SimulateStaticDocuments do not work, try adding a # slash (/) right before 'index.php' below. # RewriteRule .* /index.php [L] # For httpd.conf, use this line instead of the next one that has no '#': # RewriteRule .* /TYPO3root/index.php [L] RewriteRule .* index.php [L] ######################## ### PHP Optimisation ### ######################## # The PHP developers recommend disabling this feature. Do that. # It's deprecated and is likely to be unsupported in future versions of PHP. php_flag allow_call_time_pass_reference off # TYPO3 works fine with register_globals turned off. # This is highly recommended! php_flag register_globals off # PHP may not declare the argv & argc variables (that would contain the GET # information). # TYPO3 doesn't need this, so just turn it off. php_flag register_argc_argv off # Magic quotes for runtime-generated data (data from SQL, exec(), etc.) php_flag magic_quotes_gpc off # Order in which PHP registers GET, POST, Cookie and Built-in variables php_value variables_order GPCS ##################### ### Miscellaneous ### ##################### # Make sure that directory listings are disabled Options -Indexes