XOS-Shop/xos_shop_system/master/shop/.htaccess - Htaccess File

XOS-Shop/xos_shop_system/master/shop/.htaccess

#
# 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)
#
#  php_value session.use_trans_sid 0
#  php_value register_globals 0

##-- Customization of HTTP request and response headers
<IfModule mod_headers.c>
  <FilesMatch ".(ico|jpe?g|png|gif|swf|flv|ttf|woff|woff2)$">
    Header set Cache-Control "max-age=2592000, public"
  </FilesMatch>
  <FilesMatch ".(css)$">
    Header set Cache-Control "max-age=604800, public"
  </FilesMatch>
  <FilesMatch ".(js)$">
    Header set Cache-Control "max-age=216000, private"
  </FilesMatch>
  <FilesMatch ".(xml|txt)$">
    Header set Cache-Control "max-age=216000, public, must-revalidate"
  </FilesMatch>
  <FilesMatch ".(html|htm|php)$">
    Header set Cache-Control "max-age=1, private, must-revalidate"
  </FilesMatch>
</IfModule>

##-- Generation of Expires and Cache-Control HTTP headers
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/ttf "access plus 2592000 seconds"  
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType text/html "access plus 1 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
</IfModule>

<IfModule mod_rewrite.c>
  AcceptPathInfo On
  RewriteEngine On
  
#########################  
# RewriteBase instructions
#########################
# Change RewriteBase dependent on how your shop is accessed as below.
# http://www.mysite.com = RewriteBase /
# http://www.mysite.com/catalog/ = RewriteBase /catalog/
# http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/
# Change the following line using the instructions above 
#  RewriteBase / 

#########################   
# gzip for '.js', '.css', '.svg' and '.ttf' files 
#########################
# RewriteRule ^(.*.js) gzip.php?type=js&file=$1
# RewriteRule ^(.*.css) gzip.php?type=css&file=$1
# RewriteRule ^(.*.svg) gzip.php?type=svg&file=$1
# RewriteRule ^(.*.ttf) gzip.php?type=ttf&file=$1 
    
#########################
# redirect http to https
#########################
#
# RewriteCond %{HTTPS} !=on
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#########################
# redirect https to http
#########################
#
# RewriteCond %{HTTPS} =on
# RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#########################
# redirect no-www to www
#########################
#
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} ^(?!www.)(.+)$ [NC]
# RewriteCond %{HTTP_HOST} ^(?!localhost)(.+)$ [NC]
# RewriteCond %{HTTP_HOST} ^(?!.+..+..+)(.+) [NC]    
# RewriteRule ^ http://www.%1%{REQUEST_URI} [L,R=301]
# RewriteCond %{HTTPS} =on
# RewriteCond %{HTTP_HOST} ^(?!www.)(.+)$ [NC]
# RewriteCond %{HTTP_HOST} ^(?!localhost)(.+)$ [NC] 
# RewriteCond %{HTTP_HOST} ^(?!.+..+..+)(.+) [NC]   
# RewriteRule ^ https://www.%1%{REQUEST_URI} [L,R=301]

#########################
# redirect www to no-www
#########################
#
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
# RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
# RewriteCond %{HTTPS} =on
# RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
# RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301] 

  RewriteRule ^(.*).html/a(.*)$ index.php$2 [L]  
  RewriteRule ^(.*).html/b(.*)$ product_info.php$2 [L]
  RewriteRule ^(.*).html/c(.*)$ content.php$2 [L]
  RewriteRule ^(.*).html/d(.*)$ specials.php$2 [L]
  RewriteRule ^(.*).html/e(.*)$ products_new.php$2 [L]
  RewriteRule ^(.*).html/f(.*)$ newsletter_subscribe.php$2 [L]
  RewriteRule ^(.*).html/g(.*)$ reviews.php$2 [L]
  RewriteRule ^(.*).html/h(.*)$ product_reviews.php$2 [L]
  RewriteRule ^(.*).html/i(.*)$ product_reviews_info.php$2 [L]
  RewriteRule ^(.*).html/k(.*)$ tell_a_friend.php$2 [L]
  RewriteRule ^(.*).html/l(.*)$ shopping_cart.php$2 [L]
  RewriteRule ^(.*).html/m(.*)$ login.php$2 [L]
  RewriteRule ^(.*).html/n(.*)$ create_account.php$2 [L]
  RewriteRule ^(.*).html/o(.*)$ password_forgotten.php$2 [L]
  RewriteRule ^(.*).html/p(.*)$ advanced_search_and_results.php$2 [L]
  RewriteRule ^(.*).html/q(.*)$ search_result.php$2 [L]
  RewriteRule ^(.*).html/r(.*)$ cookie_usage.php$2 [L]       
</IfModule>

On Github License

Files

Download PDF of Htaccess file
downgrade-1.0, force-response-1.0, HTTP_HOST, HTTPS, nokeepalive, REQUEST_URI

Comments

Apache