YoPox/IdioWeb/master/.htaccess - Htaccess File

YoPox/IdioWeb/master/.htaccess

# -----------------------------------------------------------------------
# Defining MIME types to ensure the web server actually knows about them.
# -----------------------------------------------------------------------
<IfModule mod_mime.c>
    AddType application/javascript          js
    AddType application/vnd.ms-fontobject   eot
    AddType application/x-font-ttf          ttf ttc
    AddType font/opentype                   otf
    AddType application/x-font-woff         woff
    AddType image/svg+xml                   svg svgz
    AddEncoding gzip                        svgz
</Ifmodule>

# -----------------------------------------------------------------------
# Compressing output.
# -----------------------------------------------------------------------
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
    AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</Ifmodule>

#ne pas mettre en cache si ces fichiers le sont déjà
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip

#les proxies doivent donner le bon contenu
Header append Vary User-Agent env=!dont-vary

# BEGIN Expire headers
<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresDefault "access plus 7200 seconds"
 ExpiresByType image/jpg "access plus 2592000 seconds"
 ExpiresByType image/jpeg "access plus 2592000 seconds"
 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 A259200
 ExpiresByType application/x-javascript "access plus 2592000 seconds"
 ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# END Expire headers

# 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

# KILL THEM ETAGS
Header unset ETag
FileETag none

# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>

# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>

# protection de la lecture des répertoires
Options -Indexes

Options +FollowSymLinks

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#RewriteRule ^home ~Yopox/Web/IdioWeb/index.php [NC,L]
#RewriteRule ^categories ~Yopox/Web/IdioWeb/cat_view.php [NC,L]
#RewriteRule ^write_article ~Yopox/Web/IdioWeb/write.php [NC,L]
#RewriteRule ^sign_in ~Yopox/Web/IdioWeb/signInPage.php [NC,L]
#RewriteRule ^sign_up ~Yopox/Web/IdioWeb/signUpPage.php [NC,L]
#RewriteRule ^user_profile ~Yopox/Web/IdioWeb/profile.php [NC,L]
#RewriteRule ^articles/([0-9a-zA-Z-]+)$ ~Yopox/Web/IdioWeb/article.php?art=$1 [NC,L]
#RewriteRule ^edit/([0-9a-zA-Z-]+)$ ~Yopox/Web/IdioWeb/master_edit.php?id=$1 [NC,L]
#RewriteRule ^categorie/(.+)/([0-9]+)$ ~Yopox/Web/IdioWeb/get_cat.php?cat=$1&page=$2 [NC,L]
#RewriteRule ^redacteur/(.+)/([0-9]+)$ ~Yopox/Web/IdioWeb/get_redac.php?author=$1&page=$2 [NC,L]
#RewriteRule ^random_article ~Yopox/Web/IdioWeb/random.php [NC,L]

RewriteRule ^home index.php [NC,L]
RewriteRule ^categories cat_view.php [NC,L]
RewriteRule ^write_article write.php [NC,L]
RewriteRule ^sign_in signInPage.php [NC,L]
RewriteRule ^sign_up signUpPage.php [NC,L]
RewriteRule ^user_profile profile.php [NC,L]
RewriteRule ^articles/([0-9a-zA-Z-]+)$ article.php?art=$1 [NC,L]
RewriteRule ^edit/([0-9a-zA-Z-]+)$ master_edit.php?id=$1 [NC,L]
RewriteRule ^categorie/(.+)/([0-9]+)$ get_cat.php?cat=$1&page=$2 [NC,L]
RewriteRule ^redacteur/(.+)/([0-9]+)$ get_redac.php?author=$1&page=$2 [NC,L]
RewriteRule ^random_article random.php [NC,L]

On Github License

Files

Download PDF of Htaccess file
DEFLATE, no-gzip, REQUEST_FILENAME, REQUEST_URI

Comments

Apache