Options FollowSymLinks
RewriteEngine On

#Language Context
RewriteRule ^([a-z][a-z])/(.*)$ ./$2?%{QUERY_STRING}&LANG=$1

#Country Context
RewriteRule ^([A-Z][A-Z])/(.*)$ ./$2?%{QUERY_STRING}&COUNTRY_CODE=$1

# __REMOVE_BEGIN__(SINGLEUSERVER)
#Compere Restricted Context
RewriteRule ^cp([0-9]+)$ ./?cmd=go&url=./cp$1/
RewriteRule ^cp([0-9]+)/(.*)?$ ./$2?%{QUERY_STRING}&CPID=$1
# __REMOVE_END__(SINGLEUSERVER)

#Non-Cookie Mobile Setting
RewriteRule ^m-([^\/]+)/(.*)$ ./$2?%{QUERY_STRING}&NOCOOKIE=1&MOBILE=1&SESSIONID=$1
RewriteRule ^m/(.*)$ ./$1?%{QUERY_STRING}&NOCOOKIE=1&MOBILE=1

#Theme
RewriteRule ^thm-([a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])/(.*)$ ./$2?%{QUERY_STRING}&THEME=$1

#Query Translate
RewriteRule ^qx-(.*).html$ ./rewrite.php?xquery=$1&%{QUERY_STRING}

#Retrieve Theme Image
RewriteRule ^image/(.*)$ ./?cmd=getimage&NOSESSION=1&file=$1&%{QUERY_STRING}

#Retrieve Theme Image
RewriteRule ^qrcode$ ./?cmd=getqrcode&NOSESSION=1&%{QUERY_STRING}

#Retrieve Uploaded Files
RewriteRule ^upload/(.*)$ ./?cmd=upload.retrieve&NOSESSION=1&path=$1&%{QUERY_STRING}

#Contents for Search Engines only
RewriteRule ^searchenginemirror-[0-9]+/(.*)$ $1
