<files ".htaccess">
	order allow,deny
	deny from all
</files>

# --- Note! ------- >
#
#     If your server is running Apache and mod_rewrite is enabled,
#     but redirection doesn't work, try to comment out "Options
#     +FollowSymlinks" and/or uncomment out "RewriteBase /".
#
# - - - - - - - - - <

RewriteEngine on
Options +FollowSymlinks
#RewriteBase /

# EXISTING DIRECTORIES
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([-_a-zA-Z0-9]+)/(.*)/$ index.php?ref=$1&redir=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([-_a-zA-Z0-9]+)/(.*)$ index.php?ref=$1&redir=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([-_a-zA-Z0-9]+)/$ index.php?ref=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([-_a-zA-Z0-9]+)$ index.php?ref=$0 [L]

# RewriteRule ^([-_a-zA-Z0-9]+) index.php?ref=$1
