Quellcode durchsuchen

fixe the 302 redirection cache probleme with headers in htaccess

Bachir Soussi Chiadmi vor 12 Jahren
Ursprung
Commit
cb791f03ff
2 geänderte Dateien mit 31 neuen und 21 gelöschten Zeilen
  1. 13 4
      .htaccess
  2. 18 17
      maintenance/index.html

+ 13 - 4
.htaccess

@@ -116,14 +116,23 @@ DirectoryIndex index.php index.html index.htm
   RewriteCond %{REQUEST_URI} !=/favicon.ico
   RewriteRule ^ index.php [L]
 
+  ## local
   # RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
-  # maison quentin
+  ## maison quentin
   # RewriteCond %{REMOTE_ADDR} !^86\.68\.188\.175
-  # materio
+  ## materio
   # RewriteCond %{REMOTE_ADDR} !^212\.198\.136\.215
-  # maison bach
+  ## maison bach
   # RewriteCond %{REMOTE_ADDR} !^82\.230\.62\.145
-  # RewriteRule !maintenance http://www.materio.com/maintenance [L,R=302]
+  # RewriteRule !maintenance http://www.materio.com/maintenance [L,R=302,E=nocache:1]
+
+  ## http://mark.koli.ch/2010/12/set-cache-control-and-expires-headers-on-a-redirect-with-mod-rewrite.html
+  ## Set the response header if the "nocache" environment variable is set
+  ## in the RewriteRule above.
+  # Header always set Cache-Control "no-store, no-cache, must-revalidate" env=nocache
+  ## Set Expires too ...
+  # Header always set Expires "Thu, 01 Jan 1970 00:00:00 GMT" env=nocache
+
 
   # Rules to correctly serve gzip compressed CSS and JS files.
   # Requires both mod_rewrite and mod_headers to be enabled.

+ 18 - 17
maintenance/index.html

@@ -5,7 +5,8 @@
 <!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en" dir="ltr" > <![endif]-->
 <!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
 <!--[if gt IE 8]><!-->
-<html class="js no-flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" dir="ltr" lang="en"><!--<![endif]--><head>
+<html class="js no-flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" dir="ltr" lang="en"><!--<![endif]-->
+  <head>
 
     <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame 
          Remove this if you use the .htaccess -->
@@ -13,28 +14,28 @@
 
     <link type="image/png" rel="shortcut icon" href="http://www.materio.com/sites/all/themes/gui/materiobasetheme/materio-icon-O.png"> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<link rel="alternate" type="application/rss+xml" title="Materio's news" href="http://www.materio.com/en/rss/feed">
-    
+    <link rel="alternate" type="application/rss+xml" title="Materio's news" href="http://www.materio.com/en/rss/feed">
+        
     <title>Site under maintenance | materiO’</title>
     <style type="text/css" media="all">
     @import url("http://www.materio.com/modules/system/system.base.css?mu8p7n");
     @import url("http://www.materio.com/modules/system/system.menus.css?mu8p7n");
     @import url("http://www.materio.com/modules/system/system.theme.css?mu8p7n");
     </style>
-<style type="text/css" media="all">
-@import url("http://www.materio.com/sites/all/modules/contrib/mail/simplenews/simplenews.css?mu8p7n");
-@import url("http://www.materio.com/modules/field/theme/field.css?mu8p7n");
-@import url("http://www.materio.com/modules/node/node.css?mu8p7n");
-</style>
-<style type="text/css" media="all">
-@import url("http://www.materio.com/sites/all/modules/contrib/theming/extlink/extlink.css?mu8p7n");
-</style>
-<style type="text/css" media="all">
-@import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/css/normalize.css?mu8p7n");
-@import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/fonts/ubuntu/ubuntu.css?mu8p7n");
-@import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/css/styles.css?mu8p7n");
-@import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/css/nonsemantic.css?mu8p7n");
-</style>
+    <style type="text/css" media="all">
+    @import url("http://www.materio.com/sites/all/modules/contrib/mail/simplenews/simplenews.css?mu8p7n");
+    @import url("http://www.materio.com/modules/field/theme/field.css?mu8p7n");
+    @import url("http://www.materio.com/modules/node/node.css?mu8p7n");
+    </style>
+    <style type="text/css" media="all">
+    @import url("http://www.materio.com/sites/all/modules/contrib/theming/extlink/extlink.css?mu8p7n");
+    </style>
+    <style type="text/css" media="all">
+    @import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/css/normalize.css?mu8p7n");
+    @import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/fonts/ubuntu/ubuntu.css?mu8p7n");
+    @import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/css/styles.css?mu8p7n");
+    @import url("http://www.materio.com/sites/all/themes/gui/materiobasetheme/css/nonsemantic.css?mu8p7n");
+    </style>
 
     
     <!-- All JavaScript at the bottom, except for Modernizr / Respond.