par
lanfeust2 » 09 mai 2015, 15:54
L'ordre dans mon htaccess est le suivant :
Code : Tout sélectionner
<IfModule mod_headers.c>
# les .ico, .jpg, etc… seront en cache pour 30 jours
<FilesMatch "\.(ico|jpe?g|png|gif|swf|css|gz)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
#Les images .jpg seront en cache pour 30 jours
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
#Les images .png seront en cache pour 30 jours
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
Redirect permanent /document/mon-document-version1-157.html /document/mon-document-version2-157.html
<Limit GET POST>
Order Deny,Allow
Allow from all
Allow from googlebot.com
Deny from env=keep_out
</Limit>
# BEGIN Cache-Control Headers
<ifmodule mod_headers.c>
<filesmatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</filesmatch>
<filesmatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</filesmatch>
<filesmatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</filesmatch>
<filesmatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesmatch>
# Disable caching for scripts and other dynamic files
<filesmatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</filesmatch>
</ifmodule>
# END Cache-Control Headers
ErrorDocument 401 /erreurs/erreur404.php
ErrorDocument 403 /erreurs/erreur404.php
ErrorDocument 405 /erreurs/erreur404.php
ErrorDocument 404 /erreurs/erreur404.php
#Anti Listage des repertoires
Options -Indexes
<Files ~"\.ht$">
Order Allow,Deny
deny from all
Satisfy All
</Files>
<Files ~"\config.php$">
deny from all
</Files>
# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module)$">
deny from all
</FilesMatch>
<Limit GET PUT POST>
Order Allow,Deny
Allow from all
</Limit>
#Permet de faire fonctionner le rewriting donc remettre si probleme
#Options +FollowSymlinks
<IfModule mod_speling.c>
CheckSpelling On
</IfModule>
# Controle du nom de domaine et reecriture de misfu.com vers www.misfu.com et index.html et php vers la racine
RewriteCond %{HTTP_HOST} ^misfu.com$
RewriteRule ^(.*) http://www.test.com/$1 [qsa,L,R=301]
RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ (/.*)?/index.(php)
RewriteRule ^(.*)index.(php)$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ (/.*)?/index.(html)
RewriteRule ^(.*)index.(html)$ /$1 [R=301,L]
<ifmodule mod_deflate.c>
# Mettre les deux lignes suivantes en une seule
# Ici je les ai separe pour l'affichage du site
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
RewriteRule ^cours/tutoriel/(.+)-([0-9]*).html$ /afficheCours.php?cours=$2 [QSA,L]
L'ordre dans mon htaccess est le suivant :
[code]
<IfModule mod_headers.c>
# les .ico, .jpg, etc… seront en cache pour 30 jours
<FilesMatch "\.(ico|jpe?g|png|gif|swf|css|gz)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
#Les images .jpg seront en cache pour 30 jours
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
#Les images .png seront en cache pour 30 jours
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
Redirect permanent /document/mon-document-version1-157.html /document/mon-document-version2-157.html
<Limit GET POST>
Order Deny,Allow
Allow from all
Allow from googlebot.com
Deny from env=keep_out
</Limit>
# BEGIN Cache-Control Headers
<ifmodule mod_headers.c>
<filesmatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</filesmatch>
<filesmatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</filesmatch>
<filesmatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</filesmatch>
<filesmatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesmatch>
# Disable caching for scripts and other dynamic files
<filesmatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</filesmatch>
</ifmodule>
# END Cache-Control Headers
ErrorDocument 401 /erreurs/erreur404.php
ErrorDocument 403 /erreurs/erreur404.php
ErrorDocument 405 /erreurs/erreur404.php
ErrorDocument 404 /erreurs/erreur404.php
#Anti Listage des repertoires
Options -Indexes
<Files ~"\.ht$">
Order Allow,Deny
deny from all
Satisfy All
</Files>
<Files ~"\config.php$">
deny from all
</Files>
# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module)$">
deny from all
</FilesMatch>
<Limit GET PUT POST>
Order Allow,Deny
Allow from all
</Limit>
#Permet de faire fonctionner le rewriting donc remettre si probleme
#Options +FollowSymlinks
<IfModule mod_speling.c>
CheckSpelling On
</IfModule>
# Controle du nom de domaine et reecriture de misfu.com vers www.misfu.com et index.html et php vers la racine
RewriteCond %{HTTP_HOST} ^misfu.com$
RewriteRule ^(.*) http://www.test.com/$1 [qsa,L,R=301]
RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ (/.*)?/index.(php)
RewriteRule ^(.*)index.(php)$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ (/.*)?/index.(html)
RewriteRule ^(.*)index.(html)$ /$1 [R=301,L]
<ifmodule mod_deflate.c>
# Mettre les deux lignes suivantes en une seule
# Ici je les ai separe pour l'affichage du site
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
RewriteRule ^cours/tutoriel/(.+)-([0-9]*).html$ /afficheCours.php?cours=$2 [QSA,L][/code]