########################################################################################################
##				  qlWebDS - Linux/Apache Server Settings			      ##
##					qlWebDS - Directory Script				      ##
##                                                                                                    ##
##             (C) 2007-10 Contact USA, Inc. (http://www.qlWeb.com) All Rights Reserved               ##
##                                                                                                    ##
##      You may need to comment some lines on or off (#) to get proper settings for your server       ##
########################################################################################################

# New to htaccess file?
# (line WITH the # in the beginning is NOT functional - OFF)
# (line WITHOUT the # in the beginning IS functional - ON)
# You may manipulate the lines below accordingly

# For future reference you might want to enter your domain name below:
# YourDomain.com

# URL rewrite: (must do if installed in a subfolder)
# If installed in a subfolder, edit the following 6 RewriteRule lines BELOW RewriteEngine On
# Example: add   /YourSubfolder   before   /index.php (RENAME YourSubfolder with your actual subfolder name)

# Follow symbolic links in this directory (if you have problems with your hosting account's mod rewrite, try to comment off (#) the next line
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*),categ-([^-]+).htm$ /index.php?categ=$2
RewriteRule ^(.*),categ-([^-]+),sort-([^-]+).htm$ /index.php?categ=$2&sort=$3
RewriteRule ^(.*),categ-([^-]+),pg-([^-]+).htm$ /index.php?categ=$2&pg=$3
RewriteRule ^(.*),categ-([^-]+),pg-([^-]+),sort-([^-]+).htm$ /index.php?categ=$2&pg=$3&sort=$4
RewriteRule ^(.*),more-([^-]+).htm$ /index.php?site=$2
RewriteRule ^([^-]+).htm$ /index.php?page=$1

# Customized error messages: (must do if installed in a subfolder)
# If installed in a subfolder, edit the line below the example
# Example: ErrorDocument 404 YourSubfolder/404.php (RENAME YourSubfolder with your actual subfolder name)
ErrorDocument 404 /404.php

# Enter your domain to redirect http://YourDomain.com to http://www.YourDomain.com (recommended)
# Note - this htaccess method of redirection works ONLY on Linux servers having the Apache ModRewrite module enabled
# RENAME YourDomain.com with your actual domain name and remove the # from the beginning of the following 2 lines
# RewriteCond %{HTTP_HOST} ^YourDomain.com [NC]
# RewriteRule ^(.*)$ http://www.YourDomain.com/$1 [L,R=301]

# Protect directories
<Files ~ "^(backup|files|images|languages|cache(/.+)?|templates(/.+)?|java_scripts(/.+)?|fonts(/.+)?|logs(/.+)?)$">
  Order deny,allow
  Deny from all
</Files>

# Protect files
<Files ~ "^(.*)\.(inc|inc\.php|tpl|sql)$">
  Order deny,allow
  Deny from all
</Files>

# Disable directory browsing
Options -Indexes

# Set the default handler
# DirectoryIndex index.php

# Override PHP settings that cannot be changed at runtime
# If your server supports PHP settings via htaccess you can comment following two lines off
# php_value register_globals   0
# php_value session.auto_start 0
