# $Id: .htaccess,v 1.5 2005/05/19 17:09:19 Administrator Exp $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
#<Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
#</Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
<IfModule mod_setenvif.c>
  <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
  </IfDefine>
</IfModule>

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)
#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1
#</IfModule>

#-- Call time pass reference error ?!
#php_flag  allow_call_time_pass_reference On

#-----------------------------------------
#- SEO Hartmut Knig
#-----------------------------------------
#-- ! Comment this line, if you get an ERROR 500 !
Options +FollowSymlinks
RewriteBase /

# http://httpd.apache.org/docs/misc/rewriteguide.html
RewriteEngine on

#-- Sitemap
RewriteRule ^sitemap(.*)\.html$ shop_content.php?coID=8 [qsappend,L]

##-- Kategorien
RewriteCond %{REQUEST_URI} (.*)---([_0-9]+)-([_0-9]+)\.html(.*)$
RewriteRule (.*)---([_0-9]+)-([_0-9]+)\.html(.*)$ index.php?cPath=$2&page=$3&$4 [qsappend,L]
RewriteCond %{REQUEST_URI} (.*)---([_0-9]+)\.html$
RewriteRule (.*)---([_0-9]+)\.html$ index.php?cPath=$2 [qsappend,L]

##-- Produkte
RewriteRule (.*)--(.+)\.html$ product_info.php?products_id=$2 [qsappend,L]

##-- Content
RewriteRule (.*)-_-([0-9]+)\.html$ shop_content.php?coID=$2 [qsappend,L]

##-- Manufacturers
RewriteCond %{REQUEST_URI} (.*)-.-([_0-9]+)-([_0-9]+)\.html$
RewriteRule (.*)-.-([_0-9]+)-([_0-9]+)\.html$ index.php?manufacturers_id=$2&page=$3 [qsappend,L]
RewriteCond %{REQUEST_URI} (.*)-.-([_0-9]+)\.html$
RewriteRule (.*)-.-([0-9]+)\.html$ index.php?manufacturers_id=$2 [qsappend,L]

##-- SEO Links fr Angebote, Neuheiten und den Warenkorb
RewriteCond %{REQUEST_URI} Angebote___([_0-9]+)\.html$
RewriteRule Angebote___([0-9]+)\.html$ specials.php?page=$1 [qsappend,L]
RewriteCond %{REQUEST_URI} Neuheiten___([_0-9]+)\.html$
RewriteRule Neuheiten___([0-9]+)\.html$ products_new.php?page=$1 [qsappend,L]
RewriteCond %{REQUEST_URI} Warenkorb___([_0-9]+)\.html$
RewriteRule Warenkorb___([0-9]+)\.html$ shopping_cart.php?page=$1 [qsappend,L]

##-- Fehlerseiten auf die Sitemap lotsen
ErrorDocument 400 /sitemap.html?error=400
ErrorDocument 401 /sitemap.html?error=401
ErrorDocument 402 /sitemap.html?error=402
ErrorDocument 403 /sitemap.html?error=403
ErrorDocument 404 /sitemap.html?error=404
ErrorDocument 500 /sitemap.html?error=500


##-- DOMAIN 301
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]

## RewriteCond %{HTTP_HOST} ^(www\.domain\.de)(:80)? [NC]
## RewriteRule ^(.*) http://domain.de/$1 [R=301,L]


##-- Facebook Parameter entfernen
RewriteCond %{QUERY_STRING} ^(.*&|)fbclid=.*?(?:&(.*)|)$
RewriteRule (.*) /$1?%1%2 [R=301,L]


##-- Schreibfehler abfangen
##-- CheckSpelling On



##-- Ladezeit beschleunigen 

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/shtml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/ico "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/jpg "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType text/css "access plus 14 days"
ExpiresByType text/javascript "access plus 14 days"
ExpiresByType application/x-javascript "access plus 14 days"
ExpiresByType application/javascript "access plus 14 days"
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

<IfModule mod_mime.c>
  AddType application/javascript              js jsonp
  AddType application/json                    json
  AddType audio/ogg                           oga ogg
  AddType audio/mp4                           m4a f4a f4b
  AddType video/ogg                           ogv
  AddType video/mp4                           mp4 m4v f4v f4p
  AddType video/webm                          webm
  AddType video/x-flv                         flv
  AddType image/svg+xml                       svg svgz
  AddEncoding gzip                            svgz
  AddType application/vnd.ms-fontobject       eot
  AddType application/x-font-ttf              ttf ttc
  AddType font/opentype                       otf
  AddType application/x-font-woff             woff woff2
  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-web-app-manifest+json webapp
  AddType text/x-vcard                        vcf
  AddType application/x-shockwave-flash       swf
</IfModule>


