Options +FollowSymLinks
RewriteEngine On




#
# ERROR DOCUMENTS - define their if you want
#

# ErrorDocument 404 /my-error-page.html
# ErrorDocument 401 /my-error-page.html
# ErrorDocument 403 /my-error-page.html
# ErrorDocument 500 /my-error-page.html
# ErrorDocument 400 /my-error-page.html


#
# Sefrengo numeric rewrite
#

#cats
RewriteRule ^cat([0-9][0-9]*)-([1-9][0-9]?)\.html(&.*)? index.php?lang=$2&idcat=$1&$3 [QSA,L]
RewriteRule ^cat([1-9][0-9]*)\.html(&.*)? index.php?idcat=$1&$2 [QSA,L]
#pages
RewriteRule ^page([1-9][0-9]*)-([1-9][0-9]?)\.html(&.*)? index.php?lang=$2&idcatside=$1$3 [QSA,L]
RewriteRule ^page([1-9][0-9]*)\.html(&.*)? index.php?idcatside=$1$2 [QSA,L]


#
# DeDi compatible rewrite
#

#categories
RewriteCond %{QUERY_STRING} ^(.*)?$
RewriteRule ^([1-9][0-9]?)cat([0-9][0-9]*)\.html(&.*)? index.php?lang=$1&idcat=$2$3 [QSA,L]
RewriteRule ^cat([0-9][0-9]*)\.html(&.*)? index.php?idcat=$1$2 [QSA,L]
#pages
RewriteRule ^([1-9][0-9]?)side([1-9][0-9]*)\.html(&.*)? index.php?lang=$1&idcatside=$2$3 [QSA,L]
RewriteRule ^side([1-9][0-9]*)\.html(&.*)? index.php?idcatside=$1$2 [QSA,L]


#
# Sefrengo 'spoken url support' rewrite
#

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?sf_rewrite=$1 [L,QSA]