HTACCESS pour wordpress ou autre


Heroes69
WRInaute discret
WRInaute discret
 
Messages: 173
Inscription: 23 Mar 2010

HTACCESS pour wordpress ou autre

Message le Mar Mai 24, 2011 22:33

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 %{HTTP:Profile} !^[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 %{HTTP:Profile} !^[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


Heroes69
WRInaute discret
WRInaute discret
 
Messages: 173
Inscription: 23 Mar 2010

Re: HTACCESS pour wordpress ou autre

Message le Jeu Mai 26, 2011 10:10

113 vues, aucune réponses ...

merci pour votre aide ..


Marie-Aude
Modérateur
Modérateur
 
Messages: 11887
Inscription: 5 Juin 2006

Re: HTACCESS pour wordpress ou autre

Message le Jeu Mai 26, 2011 11:53

Je suis totalement désolée d'avoir regardé le sujet et de ne pas avoir signalé "je n'ai pas de réponse".

Maintenant ton message est assez illisible... la balise code ça aide dans ce genre de choses.


Heroes69
WRInaute discret
WRInaute discret
 
Messages: 173
Inscription: 23 Mar 2010

Re: HTACCESS pour wordpress ou autre

Message le Sam Mai 28, 2011 18:03

pourtant j'ai fais effort de mettre des couleurs pour que ca soit bien lisible :-'(


VOici la meme chose avec la balise code si tu trouves ca plus lisible :)

Et sérieusement c'est le desert ici ou ya personne qui optimise son site pour qu'il soit plus rapide ?

Code: Tout sélectionner
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 %{HTTP:Profile} !^[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 %{HTTP:Profile} !^[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


cedric_g
WRInaute accro
WRInaute accro
 
Messages: 3552
Inscription: 18 Jan 2006

Re: HTACCESS pour wordpress ou autre

Message le Lun Mai 30, 2011 9:01

Bonjour

Tu as deux fois la même chose au niveau de ton htaccess (écrit différemment), au niveau des expire_headers (les deux pavés qui se suivent font la même chose, écrit différemment)

Pour le reste ça me semble correct. Essayes en faisant un "CTRL+F5" avec Page Speed car parfois il mange les infos :)


Heroes69
WRInaute discret
WRInaute discret
 
Messages: 173
Inscription: 23 Mar 2010

Re: HTACCESS pour wordpress ou autre

Message le Mar Mai 31, 2011 23:44

merci pour ta réponse cedric :D
j'ai enlevé le premier pavé et j'ai toujours la même chose dans google pagespeed.

je rappelle que je suis sous 1&1. J'ai régler le problème du gzip avec un fichier php placé dans tous les répertoires (1&1 ne gère pas le gzip dans le htaccess, ca fait une erreur 500)...
mais pour ce qui est du reste, je ne sais pas quoi faire... est ce que c'est géré par 1&1 le htaccess ? je me demande la car j'ai tout essayer et rien ne se passe, j'ai toujours

Specify a character set
The following resources have no character set specified in their HTTP headers. Specifying a character set in HTTP headers can speed up browser rendering.
http://www.xxxx.com/

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:
http://www.xxx.png
http://www.xxx.jpg
http://www.xxx/style.css
http://www.xxx.png
http://www.xxx.png

Leverage browser caching
http://www.xxx.png (expiration not specified)
http://www.xxx.jpg (expiration not specified)
http://www.xxx/style.css (expiration not specified)
http://www.xxx.png (expiration not specified)
http://www.xxx.png (expiration not specified)


cedric_g
WRInaute accro
WRInaute accro
 
Messages: 3552
Inscription: 18 Jan 2006

Re: HTACCESS pour wordpress ou autre

Message le Mer Juin 01, 2011 7:46

À tout hasard, tu as essayé de tester avec YSlow (juste pour voir s'il y a des différences)


Heroes69
WRInaute discret
WRInaute discret
 
Messages: 173
Inscription: 23 Mar 2010

Re: HTACCESS pour wordpress ou autre

Message le Mer Juin 01, 2011 11:48

oui j'ai le même problème de cache avec les images :S


Si vous avez aimé cette discussion, partagez-la sur vos réseaux sociaux préférés :

Lectures recommandées sur ce thème :



Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité