apache_conf 在.htaccess中将PHP版本升级到7.0

在.htaccess中将PHP版本升级到7.0

Upgrading PHP Version to 7.0 in .htaccess
AddHandler application/x-httpd-php70 .php .php5 .php4 .php3

apache_conf 基本的vhost

nginx-basic-vhost
server {
  listen 80;
  listen [::]:80;
  
  root /var/www/example.com;
  index index.html;
  
  server_name example.com www.example.com;
  
  location / {
    try_files $uri $uri/ =404;
  }
}

apache_conf 重定向.htaccess中的某个路径

重定向.htaccess中的某个路径

.htaccess
# Redirect auf Sitemap (extern, Weiterleitung)
RewriteRule sitemap.xml$ /index.php?eID=dd_googlesitemap [L,Redirect=permanent]

# Redirect auf Sitemap (intern, Auslieferung)
RewriteRule ^sitemap\.xml$ index.php?eID=dd_googlesitemap [L]

apache_conf 从旧域重定向到新域

htaccess
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www.olddomain.com$
  RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]

apache_conf .htaccess跳过静态文件的WordPress 404错误处理

.htaccess跳过静态文件的WordPress 404错误处理

.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(robots\.txt|sitemap\.xml(\.gz)?)
    RewriteCond %{REQUEST_FILENAME} \.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
    RewriteRule .* - [L]
</IfModule>

apache_conf Linux片段

Linux片段

config.md
# Linux Config Snippets

- [Bash Customization](#Bash-Customization)
  * [Case Insensitive Tab Completion](#Case-Insensitive-Tab-Completion)
- [SSH](#SSH)
  * [Setup Remote Access by SSH Key](#Setup-Remote-Access-by-SSH-Key)

## Bash Customization

### Case Insensitive Tab Completion
```sh
echo "set completion-ignore-case on" >> ~/.inputrc
source ~/.bashrc
```

---

## SSH

### Setup Remote Access by SSH Key
1. Create RSA Key Pair
    ```sh
    ssh-keygen
    ```
    > NOTE: If an SSH key already exists you will be prompted to overwrite it - Don't do it
  
1. Copy the Public Key to the Server
    Using the `ssh-copy-id` command if it's available
    ```sh
    ssh-copy-id username@remote_host
    ```
    
    If the `ssh-copy-id` command isn't available this is an alternative
    ```sh
    cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
    ```
    
1. Authenticate to the Server Using SSH Keys
    ```sh
    ssh username@remote_host
    ```
    
1. Disable Password Authentication on the Server (Optional)
    Edit the `/etc/ssh/sshd_config` file and Add the following line (or update it if it exists)
    ```
    ...
    PasswordAuthentication no
    ...
    ```
    
    Save the file and restart the `ssh` service by running 
    ```sh
    sudo systemctl restart ssh
    ```
    
    > Before closing the terminal check that you are able to login from another terminal to avoid getting locked out

apache_conf 重写URL以删除文件扩展名

使用此代码段更新.htaccess文件以重写URL并删除文件扩展名<br/>

.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

apache_conf 缓存网站文件

更改符合特殊规则的每个文件的Cache-Control标头

.htaccess
<IfModule mod_headers.c>
    #cache CSS, JavaScript and text files for one week
   <FilesMatch "\.(js|css)$">
       Header set Cache-Control "max-age=604800"
   </FilesMatch>
  
</IfModule>

apache_conf .00 Solid Base .htaccess.md

Solid Base .htaccess为.htaccess文件创建可靠的基础。目前包括RewriteBase,Security(针对索引,文件等)和Expires Headers(缓存,性能)。

.00 Solid Base .htaccess.md
# Solid Base .htaccess

Creating a solid base for your `.htaccess` file. Currently includes RewriteBase, Security (against indexes, files, etc.), and Expires Headers (caching, performance).

* The URL REWRITES would go at the top of the file. 
* The SECURITY and the WEB PERFORMANCE can go towards the bottom... before and WordPress or WP Super Cache items.
* UPDATE 2013-08-21: Added code for forcing either non-www or www. on URLs. Also added the MultiViews option.
* UPDATE 2013-08-23: Added specific code for `wp-config.php`
* UPDATE 2013-10-04: Increased favicon expire time.
* UPDATE 2014-02-05: Removed the Force URL rewrites since there's more than one option.
* UPDATE 2014-12-10: Updated Expires Headers
* UPDATE 2015-04-10: Updated file security
.htaccess
# ######################################################################
# # SECURITY                                                           #
# ######################################################################

# ----------------------------------------------------------------------
# | File access                                                        |
# ----------------------------------------------------------------------

# Block access to directories without a default document.
# Usually you should leave this uncommented because you shouldn't allow anyone
# to surf through every directory on your server (which may includes rather
# private places like the CMS's directories).

<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

# Block access to hidden files and directories.
# This includes directories used by version control systems such as Git and SVN.

<IfModule mod_rewrite.c>
    RewriteCond %{SCRIPT_FILENAME} -d [OR]
    RewriteCond %{SCRIPT_FILENAME} -f
    RewriteRule "(^|/)\." - [F]
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

# Block access to backup and source files.
# These files may be left by some text editors and can pose a great security
# danger when anyone has access to them.

<FilesMatch "(^#.*#|\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

# Rules to block access to WordPress specific files
<files readme.html>
  Order allow,deny
  Deny from all
</files>
<files readme.txt>
  Order allow,deny
  Deny from all
</files>
<files README.md>
  Order allow,deny
  Deny from all
</files>
<files install.php>
  Order allow,deny
  Deny from all
</files>
<files wp-config.php>
  Order allow,deny
  Deny from all
</files>

# Rules to disable XML-RPC
<files xmlrpc.php>
  Order allow,deny
  Deny from all
</files>

# Deny access to all .htaccess files
<files ~ "^.*\.([Hh][Tt][Aa])">
  order allow,deny
  deny from all
  satisfy all
</files>

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Rules to protect wp-includes
  RewriteRule ^wp-admin/includes/ - [F]
  RewriteRule !^wp-includes/ - [S=3]
  RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php
  RewriteRule ^wp-includes/[^/]+\.php$ - [F]
  RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F]
  RewriteRule ^wp-includes/theme-compat/ - [F]

  # Rules to prevent php execution in uploads
  RewriteRule ^(.*)/uploads/(.*).php(.?) - [F]

  # Rules to block unneeded HTTP methods
  RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]
  RewriteRule ^(.*)$ - [F]

  # Rules to block foreign characters in URLs
  RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F).* [NC]
  RewriteRule ^(.*)$ - [F]

  # Rules to help reduce spam
  RewriteCond %{REQUEST_METHOD} POST
  RewriteCond %{REQUEST_URI} ^(.*)wp-comments-post\.php*
  RewriteCond %{HTTP_REFERER} !^(.*)CHANGETHENAMEOFYOURWEBSITEHERE.com.*
  RewriteCond %{HTTP_REFERER} !^http://jetpack\.wordpress\.com/jetpack-comment/ [OR]
  RewriteCond %{HTTP_USER_AGENT} ^$
  RewriteRule ^(.*)$ - [F]
</IfModule>


# ######################################################################
# # WEB PERFORMANCE                                                    #
# ######################################################################

# ----------------------------------------------------------------------
# | Compression                                                        |
# ----------------------------------------------------------------------

<IfModule mod_deflate.c>

    # Force compression for mangled `Accept-Encoding` request headers
    # https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html

    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
            RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
        </IfModule>
    </IfModule>

    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    # Compress all output labeled with one of the following media types.
    #
    # (!) For Apache versions below version 2.3.7 you don't need to
    # enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
    # and `</IfModule>` lines as `AddOutputFilterByType` is still in
    # the core directives.
    #
    # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype

    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE "application/atom+xml" \
                                      "application/javascript" \
                                      "application/json" \
                                      "application/ld+json" \
                                      "application/manifest+json" \
                                      "application/rdf+xml" \
                                      "application/rss+xml" \
                                      "application/schema+json" \
                                      "application/vnd.geo+json" \
                                      "application/vnd.ms-fontobject" \
                                      "application/x-font-ttf" \
                                      "application/x-javascript" \
                                      "application/x-web-app-manifest+json" \
                                      "application/xhtml+xml" \
                                      "application/xml" \
                                      "font/eot" \
                                      "font/opentype" \
                                      "image/bmp" \
                                      "image/svg+xml" \
                                      "image/vnd.microsoft.icon" \
                                      "image/x-icon" \
                                      "text/cache-manifest" \
                                      "text/css" \
                                      "text/html" \
                                      "text/javascript" \
                                      "text/plain" \
                                      "text/vcard" \
                                      "text/vnd.rim.location.xloc" \
                                      "text/vtt" \
                                      "text/x-component" \
                                      "text/x-cross-domain-policy" \
                                      "text/xml"

    </IfModule>

    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    # Map the following filename extensions to the specified
    # encoding type in order to make Apache serve the file types
    # with the appropriate `Content-Encoding` response header
    # (do note that this will NOT make Apache compress them!).
    #
    # If these files types would be served without an appropriate
    # `Content-Enable` response header, client applications (e.g.:
    # browsers) wouldn't know that they first need to uncompress
    # the response, and thus, wouldn't be able to understand the
    # content.
    #
    # https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding

    <IfModule mod_mime.c>
        AddEncoding gzip              svgz
    </IfModule>

</IfModule>

# ----------------------------------------------------------------------
# | ETags                                                              |
# ----------------------------------------------------------------------

# Remove `ETags` as resources are sent with far-future expires headers.
#
# https://developer.yahoo.com/performance/rules.html#etags
# https://tools.ietf.org/html/rfc7232#section-2.3

# `FileETag None` doesn't work in all cases.
<IfModule mod_headers.c>
    Header unset ETag
</IfModule>

FileETag None

# ----------------------------------------------------------------------
# | Expires headers                                                    |
# ----------------------------------------------------------------------

# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#
# https://httpd.apache.org/docs/current/mod/mod_expires.html

<IfModule mod_expires.c>

    ExpiresActive on
    ExpiresDefault                                      "access plus 1 month"

  # CSS
    ExpiresByType text/css                              "access plus 1 year"

  # Data interchange
    ExpiresByType application/atom+xml                  "access plus 1 hour"
    ExpiresByType application/rdf+xml                   "access plus 1 hour"
    ExpiresByType application/rss+xml                   "access plus 1 hour"

    ExpiresByType application/json                      "access plus 0 seconds"
    ExpiresByType application/ld+json                   "access plus 0 seconds"
    ExpiresByType application/schema+json               "access plus 0 seconds"
    ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
    ExpiresByType application/xml                       "access plus 0 seconds"
    ExpiresByType text/xml                              "access plus 0 seconds"

  # Favicon (cannot be renamed!) and cursor images
    ExpiresByType image/vnd.microsoft.icon              "access plus 1 year"
    ExpiresByType image/x-icon                          "access plus 1 year"

  # HTML
    ExpiresByType text/html                             "access plus 0 seconds"

  # JavaScript
    ExpiresByType application/javascript                "access plus 1 year"
    ExpiresByType application/x-javascript              "access plus 1 year"
    ExpiresByType text/javascript                       "access plus 1 year"

  # Manifest files
    ExpiresByType application/manifest+json             "access plus 1 year"

    ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    ExpiresByType text/cache-manifest                   "access plus 0 seconds"

  # Media files
    ExpiresByType audio/ogg                             "access plus 1 month"
    ExpiresByType image/bmp                             "access plus 1 month"
    ExpiresByType image/gif                             "access plus 1 month"
    ExpiresByType image/jpeg                            "access plus 1 month"
    ExpiresByType image/png                             "access plus 1 month"
    ExpiresByType image/svg+xml                         "access plus 1 month"
    ExpiresByType video/mp4                             "access plus 1 month"
    ExpiresByType video/ogg                             "access plus 1 month"
    ExpiresByType video/webm                            "access plus 1 month"

  # Web fonts

    # Embedded OpenType (EOT)
    ExpiresByType application/vnd.ms-fontobject         "access plus 1 year"
    ExpiresByType font/eot                              "access plus 1 year"

    # OpenType
    ExpiresByType font/opentype                         "access plus 1 year"

    # TrueType
    ExpiresByType application/x-font-ttf                "access plus 1 year"

    # Web Open Font Format (WOFF) 1.0
    ExpiresByType application/font-woff                 "access plus 1 year"
    ExpiresByType application/x-font-woff               "access plus 1 year"
    ExpiresByType font/woff                             "access plus 1 year"

    # Web Open Font Format (WOFF) 2.0
    ExpiresByType application/font-woff2                "access plus 1 year"

  # Other
    ExpiresByType text/x-cross-domain-policy            "access plus 1 week"

</IfModule>

apache_conf 理想.htaccess http://habrahabr.ru/post/154643/

理想.htaccess http://habrahabr.ru/post/154643/

.htaccess
# Этот .htaccess поможет сделать ваш сайт быстрей.
# Пользуйтесь на здоровье себе и вашему сайту.
# Автор: Алекснадр Белов aka alex Roosso
# Сайт: http://www.black-web.ru
# ICQ: 3405729
 
Options All -ExecCGI -Indexes -Includes +FollowSymLinks
#Options -MultiViews
 
# REWRITE ___________________
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /
	RewriteCond %{HTTP_HOST} ^iblog
	RewriteRule (.*) http://www.iblog.su/$1 [R=301,L]
	RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
	RewriteRule ^index\.php$ http://www.iblog.su/ [R=301,L]
</IfModule>
 
# REDIRICT __________________
# Redirect 301 /index.html /index.php
<IfModule mod_rewrite.c>
	# RewriteRule ^news/([^/\.]+)/?$ news.php?news=$1 [L]
	# RewriteRule ^(.*\.((js)|(css)))$ plugin/GzipFile.php?file=$1
	# RewriteRule \.css$ plugin/GzipFile.php?file=$1
	# RewriteRule \.js$ plugin/GzipFile.php?file=$1
</IfModule>
# RedirectMatch 301 /blog(.*) http://www.iblog.su/$1
 
 
# SECURE ____________________
<IfModule mod_ssl.c>
	# SSLOptions +StrictRequire
	# SSLRequireSSL
	# SSLRequire %{HTTP_HOST} eq "iblog.su"
</IfModule>
<IfModule mod_rewrite.c>
	# RewriteCond %{HTTPS} !on
	# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
	# RewriteCond %{SERVER_PORT} !^443
	# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
 
	# Блокировать любой запрос, пытающийся испортить base64_encode через URL
	RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
	# Блокировать любой запрос, содержащий тег <script> в URL
	RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
	# Блокировать любой запрос, пытающийся установить значение глобальных переменных PHP через URL
	RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
	# Блокировать любой запрос, пытающийся изменить _REQUEST переменную через URL
	RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
	# Перенаправлять заблокированные запросы
	RewriteRule .* index.php [F]
 
	# и запрошенный путь не соответствует пути к физическому файлу
	RewriteCond %{REQUEST_FILENAME} !-f
	# и запрошенный путь не соответствует пути к физической папке
	RewriteCond %{REQUEST_FILENAME} !-d
	# то перенаправить запрос на скрипт index.php
	RewriteRule .* index.php [L]
</IfModule>
 
 
# HOTLINKING ________________
<IfModule mod_rewrite.c>
	# RewriteCond %{HTTP_REFERER} !^$
	# RewriteCond %{HTTP_REFERER} !^http://([ -a-z0-9]  \.)?ibog\.su [NC]
	# RewriteRule \.(gif|jpe?g|png)$ - [F,NC,L]
</IfModule>
 
# HANDLER ___________________
AddHandler application/x-httpd-php .html
AddHandler cgi-script .pl .py .jsp .asp .htm .shtml .sh .cgi
AddType application/x-javascript .js
AddType application/json json
AddType text/css .css
AddType text/xml .xml
AddType text/x-component .htc
# Audio
AddType audio/ogg oga ogg
AddType audio/mp4 m4a f4a f4b
# Video
AddType video/ogg ogv
AddType video/mp4 mp4 m4v f4v f4p
AddType video/webm webm
AddType video/x-flv flv
# SVG
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# Webfonts
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
# Assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest appcache manifest
AddType text/x-component htc
AddType application/xml rss atom xml rdf
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz
AddType application/x-web-app-manifest+json webapp
AddType text/x-vcard vcf
AddType application/x-shockwave-flash swf
AddType text/vtt vtt
AddType application/octet-stream .doc .mov .avi .pdf .xls .rar .zip .mp3 .wmv .ppt .tar .gz .docx .xlsx
# ForceType application/x-httpd-php
 
# INDEX FILE ________________
DirectoryIndex index.php
 
# GZIP ______________________
<IfModule mod_gzip.c>
	mod_gzip_on         Yes
	mod_gzip_dechunk    Yes
	mod_gzip_item_include file		\.(html?|txt|css|js|php|pl)$
	mod_gzip_item_include mime		^text\.*
	mod_gzip_item_include mime		^application/x-javascript.*
	mod_gzip_item_include mime		^application/x-font-woff.*
	mod_gzip_item_exclude mime		^image\.*
	mod_gzip_item_exclude rspheader	^Content-Encoding:.*gzip.*
</IfModule>
<ifModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript application/x-font-woff image/jpg image/jpeg
</ifModule>
 
# PHP _______________________
php_value	upload_max_filesize	32M
php_value	post_max_size		10M
php_value	default_charset utf-8
# php_value	max_execution_time 200
# php_value	max_input_time 200
# php_flag register_globals Off
# php_value session.name sid
# php_flag magic_quotes_gpc Off
# php_flag expose_php Off
# php_value error_reporting -1
# php_flag log_errors On
# php_flag display_errors Off
# php_flag display_startup_errors Off
# php_flag html_errors Off
# php_flag ignore_repeated_errors Off
# php_flag ignore_repeated_source Off
# php_value log_errors_max_len 1024
# php_value error_prepend_string " "
# php_value error_append_string " "
<IfModule php5_module>
	# php_value session.cookie_httponly true
</IfModule>
 
# OTHER SETTINGS ____________
<IfModule mod_setenvif.c>
	SetEnv TZ Europe/Moscow
</IfModule>
ServerSignature Off
# AddDefaultCharset UTF-8
# AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
 
# CACHE AND Headers _________
<ifModule mod_headers.c>
	<FilesMatch "\.(html|htm)$">
		Header set Cache-Control "max-age=43200"
	</FilesMatch>
	<FilesMatch "\.(js|css|txt)$">
		Header set Cache-Control "max-age=604800"
	</FilesMatch>
	<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png|jpe?g)$">
		Header set Cache-Control "max-age=2592000"
	</FilesMatch>
	<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
		Header unset Cache-Control
	</FilesMatch>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
		Header set Access-Control-Allow-Origin "*"
	</FilesMatch>
	<FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
		Header unset X-UA-Compatible
	</FilesMatch>
</IfModule>
<ifModule mod_expires.c>
	ExpiresActive On
	ExpiresDefault "access plus 5 seconds"
	ExpiresByType image/x-icon "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"
	ExpiresByType video/ogg "access plus 1 month"
	ExpiresByType audio/ogg "access plus 1 month"
	ExpiresByType video/mp4 "access plus 1 month"
	ExpiresByType video/webm "access plus 1 month"
	ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
	ExpiresByType text/css "access plus 604800 seconds"
	ExpiresByType text/javascript "access plus 604800 seconds"
	ExpiresByType application/javascript "access plus 604800 seconds"
	ExpiresByType application/x-javascript "access plus 604800 seconds"
	ExpiresByType text/html "access plus 43200 seconds"
	ExpiresByType application/xhtml+xml "access plus 600 seconds"
	ExpiresByType text/xml "access plus 600 seconds"
	ExpiresByType application/xml "access plus 600 seconds"
	ExpiresByType application/json "access plus 600 seconds"
	ExpiresByType application/rss+xml "access plus 1 hour"
	ExpiresByType application/atom+xml "access plus 1 hour"
	ExpiresByType text/x-component "access plus 1 week"
	ExpiresByType application/x-font-ttf "access plus 1 month"
	ExpiresByType font/opentype "access plus 1 month"
	ExpiresByType application/x-font-woff "access plus 1 month"
	ExpiresByType image/svg+xml "access plus 1 month"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
</ifModule>
 
 
# Bad Rquest
ErrorDocument 400 /index.php?page=e400
 
# Authorization Required
ErrorDocument 401 /index.php?page=e401
 
# Forbidden
ErrorDocument 403 /index.php?page=e403
 
# Not found
ErrorDocument 404 /index.php?page=e404
 
# Method Not Allowed
ErrorDocument 405 /index.php?page=e405
 
# Request Timed Out
ErrorDocument 408 /index.php?page=e408
 
# Request URI Too Long
ErrorDocument 414 /index.php?page=notfound
 
# Internal Server Erro
ErrorDocument 500 /index.php?page=notfound
 
# Not Implemented
ErrorDocument 501 /index.php?page=notfound
 
# Bad Gateway 
ErrorDocument 502 /index.php?page=notfound
 
# Service Unavailable 
ErrorDocument 503 /index.php?page=notfound
 
# Gateway Timeout
ErrorDocument 504 /index.php?page=notfound