Bonjour à tous, je viens vous demander de l'aide car cela fait une semaine que j'essaie de faire un htaccess pour un de mes sites qui fonctionne sur wordpress et je suis en galère !!
Je suis sur 1&1 avec la dernière version de wordpress 3.1.2
Quand je passe le site sous l'outil pagespeed online de Google, j'ai ce genre de recommandation :
________________________________________________________________
Leverage browser caching
...com/style.css (expiration not specified)
...com/xxxx.jpg (expiration not specified) x5
...com/xxxx.png (expiration not specified) x5
static.ak.connect.facebook.com/connect.php/fr_FR (6.5 minutes)
static.ak.connect.facebook.com/.../XFBML (7.5 minutes)
static.ak.connect.facebook.com/.../connect-css (14 minutes)
google-analytics.com/ga.js (24 hours)
google.fr/cse/brand?form=cse-search-box&lang=fr (2 days)
google.fr/.../google_custom_search_watermark.gif (2 days)
________________________________________________________________
Specify a cache validator
The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources:
...com/style.css
...com/xxxx.jpg
...com/xxxx.png
google.fr/cse/brand?form=cse-search-box&lang=fr
________________________________________________________________
VOICI LA BETE : mon .htaccess à la base du site : Si quelqu'un si connait et peu me donner la solution
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
SetEnv REGISTER_GLOBALS 0
SetEnv ZEND_OPTIMIZER 1
SetEnv MAGIC_QUOTES 0
SetEnv PHP_VER 5
# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*)\.(flv|gif|jpg|jpeg|png|ico|swf|css|js|xml|txt|htm|html)$ /media.php?file=$1.$2 [L]
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTProfile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond /kunden/homepages/17/xx/htdocs/xx/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz" [L]
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTProfile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond /kunden/homepages/17/xx/htdocs/xx/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html" [L]
</IfModule>
# END WPSuperCache
# Protection du fichier htacces
<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>
# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
Header set Cache-Control
Header unset Last-Modified
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
Header unset Cache-Control
Header set ExpiresDefault "access plus 30 days"
</FilesMatch>
<FilesMatch "\.(js|css|xml|gz)$">
Header set Cache-Control
Header unset Last-Modified
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
Header unset Cache-Control
Header set ExpiresDefault "access plus 30 days"
</FilesMatch>
<filesMatch "\.(php|html|htm)$">
Header set Cache-Control
Header unset Last-Modified
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
Header unset Cache-Control
Header set ExpiresDefault "access plus 30 days"
</filesMatch>
</IfModule>
# END Cache-Control Headers
Header unset ETag
FileETag none
Header unset Pragma
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/ico A31556926
ExpiresByType image/icon A31556926
ExpiresByType image/x-icon A31556926
ExpiresByType text/css A31556926
ExpiresByType text/javascript A31556926
ExpiresByType text/html A31556926
ExpiresByType application/xhtml+xml A31556926
ExpiresByType application/javascript A31556926
ExpiresByType application/x-javascript A31556926
ExpiresByType application/x-shockwave-flash A31556926
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
ExpiresActive Off
</FilesMatch>
</IfModule>
# END Expire headers
<IfModule mod_expires.c>
ExpiresByType image/jpg "access plus 2 years"
ExpiresByType image/jpeg "access plus 2 years"
ExpiresByType image/gif "access plus 2 years"
ExpiresByType image/png "access plus 2 years"
ExpiresByType image/x-icon "modification plus 2 years"
ExpiresByType application/x-shockwave-flash "modification plus 2 years"
ExpiresByType text/css "modification plus 2 years"
ExpiresByType text/javascript "modification plus 2 years"
ExpiresByType text/html "modification plus 2 years"
ExpiresByType text/xml "modification plus 2 years"
ExpiresDefault "modification plus 2 years"
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Je suis sur 1&1 avec la dernière version de wordpress 3.1.2
Quand je passe le site sous l'outil pagespeed online de Google, j'ai ce genre de recommandation :
________________________________________________________________
Leverage browser caching
...com/style.css (expiration not specified)
...com/xxxx.jpg (expiration not specified) x5
...com/xxxx.png (expiration not specified) x5
static.ak.connect.facebook.com/connect.php/fr_FR (6.5 minutes)
static.ak.connect.facebook.com/.../XFBML (7.5 minutes)
static.ak.connect.facebook.com/.../connect-css (14 minutes)
google-analytics.com/ga.js (24 hours)
google.fr/cse/brand?form=cse-search-box&lang=fr (2 days)
google.fr/.../google_custom_search_watermark.gif (2 days)
________________________________________________________________
Specify a cache validator
The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources:
...com/style.css
...com/xxxx.jpg
...com/xxxx.png
google.fr/cse/brand?form=cse-search-box&lang=fr
________________________________________________________________
VOICI LA BETE : mon .htaccess à la base du site : Si quelqu'un si connait et peu me donner la solution
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
SetEnv REGISTER_GLOBALS 0
SetEnv ZEND_OPTIMIZER 1
SetEnv MAGIC_QUOTES 0
SetEnv PHP_VER 5
# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*)\.(flv|gif|jpg|jpeg|png|ico|swf|css|js|xml|txt|htm|html)$ /media.php?file=$1.$2 [L]
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTProfile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond /kunden/homepages/17/xx/htdocs/xx/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz" [L]
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTProfile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond /kunden/homepages/17/xx/htdocs/xx/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html" [L]
</IfModule>
# END WPSuperCache
# Protection du fichier htacces
<Files .htaccess>
Order Allow,Deny
Deny from all
</Files>
# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
Header set Cache-Control
Header unset Last-Modified
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
Header unset Cache-Control
Header set ExpiresDefault "access plus 30 days"
</FilesMatch>
<FilesMatch "\.(js|css|xml|gz)$">
Header set Cache-Control
Header unset Last-Modified
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
Header unset Cache-Control
Header set ExpiresDefault "access plus 30 days"
</FilesMatch>
<filesMatch "\.(php|html|htm)$">
Header set Cache-Control
Header unset Last-Modified
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
Header unset Cache-Control
Header set ExpiresDefault "access plus 30 days"
</filesMatch>
</IfModule>
# END Cache-Control Headers
Header unset ETag
FileETag none
Header unset Pragma
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/ico A31556926
ExpiresByType image/icon A31556926
ExpiresByType image/x-icon A31556926
ExpiresByType text/css A31556926
ExpiresByType text/javascript A31556926
ExpiresByType text/html A31556926
ExpiresByType application/xhtml+xml A31556926
ExpiresByType application/javascript A31556926
ExpiresByType application/x-javascript A31556926
ExpiresByType application/x-shockwave-flash A31556926
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
ExpiresActive Off
</FilesMatch>
</IfModule>
# END Expire headers
<IfModule mod_expires.c>
ExpiresByType image/jpg "access plus 2 years"
ExpiresByType image/jpeg "access plus 2 years"
ExpiresByType image/gif "access plus 2 years"
ExpiresByType image/png "access plus 2 years"
ExpiresByType image/x-icon "modification plus 2 years"
ExpiresByType application/x-shockwave-flash "modification plus 2 years"
ExpiresByType text/css "modification plus 2 years"
ExpiresByType text/javascript "modification plus 2 years"
ExpiresByType text/html "modification plus 2 years"
ExpiresByType text/xml "modification plus 2 years"
ExpiresDefault "modification plus 2 years"
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress