<Files .htaccess>
order allow,deny
deny from all
</Files>

RewriteEngine on
RewriteRule ^index\.html$ index.php
RewriteRule ^index-page-([0-9]+)\.html$ index.php?page=$1

RewriteRule ^lien-he\.html$ index.php?act=contact
RewriteRule ^tim-kiem\.html$ index.php?act=search
RewriteRule ^tim-kiem-([a-zA-Z0-9_-]+)\.html$ index.php?act=search&type=$1
RewriteRule ^([a-zA-Z0-9_-]+)-posts-([0-9]+)\.html$ index.php?act=posts&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-posts-all\.html$ index.php?act=allposts
RewriteRule ^([a-zA-Z0-9_-]+)-posts-all-([0-9]+)\.html$ index.php?act=allposts&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-posts-all-([0-9]+)-page-([0-9]+)\.html$ index.php?act=allposts&id=$2&page=$3
RewriteRule ^([a-zA-Z0-9_-]+)-categories-([0-9]+)\.html$ index.php?act=categories&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-categories-([0-9]+)-page-([0-9]+)\.html$ index.php?act=categories&id=$2&page=$3

RewriteRule ^([a-zA-Z0-9_-]+)-tags-([0-9]+)\.html$ index.php?act=tags&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-tags-([0-9]+)-page-([0-9]+)\.html$ index.php?act=tags&id=$2&page=$3

RewriteRule ^([a-zA-Z0-9_-]+)-item-([0-9]+)\.html$ index.php?act=item&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-item-all\.html$ index.php?act=allitem
RewriteRule ^([a-zA-Z0-9_-]+)-item-all-([0-9]+)\.html$ index.php?act=allitem&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-item-all-([0-9]+)-page-([0-9]+)\.html$ index.php?act=allitem&id=$2&page=$3
RewriteRule ^([a-zA-Z0-9_-]+)-kinditem-([0-9]+)\.html$ index.php?act=kinditem&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-kinditem-([0-9]+)-page-([0-9]+)\.html$ index.php?act=kinditem&id=$2&page=$3

RewriteRule ^([a-zA-Z0-9_-]+)-addcart-([0-9]+)\.html$ index.php?act=addcart&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)-delcart-([0-9]+)\.html$ index.php?act=delcart&iddel=$2
RewriteRule ^([a-zA-Z0-9_-]+)-cart\.html$ index.php?act=addcart
RewriteRule ^([a-zA-Z0-9_-]+)-bill\.html$ index.php?act=bill
RewriteRule ^([a-zA-Z0-9_-]+)-bill-([0-9]+)\.html$ index.php?act=bill&idcus=$2

RewriteRule ^tra-cuu\.html$ index.php?act=tracuu
RewriteRule ^tra-cuu-van-ban\.html$ index.php?act=tracuuvanban
RewriteRule ^tra-cuu-van-ban-tim-kiem\.html$ index.php?act=tracuuvanbansearch
RewriteRule ^tra-cuu-van-ban-all-([0-9]+)\.html$ index.php?act=tracuuvanban&id=$1
RewriteRule ^tra-cuu-van-ban-all-([0-9]+)-page-([0-9]+)\.html$ index.php?act=tracuuvanban&id=$1&page=$2
RewriteRule ^([a-zA-Z0-9_-]+)-van-ban-([0-9]+)\.html$ index.php?act=vanban&id=$2

RewriteRule ^([a-zA-Z0-9_-]+).([0-9]+)$ mod_ads_link/index.php

# prevent viewing of a specific file
<files config.php>
order allow,deny
deny from all
</files>

<files account_add.php>
order allow,deny
deny from all
</files>

<files account_management.php>
order allow,deny
deny from all
</files>

<files account_recyclebin.php>
order allow,deny
deny from all
</files>

<files booking_management.php>
order allow,deny
deny from all
</files>

<files booking_recyclebin.php>
order allow,deny
deny from all
</files>

<files categories_add.php>
order allow,deny
deny from all
</files>

<files categories_management.php>
order allow,deny
deny from all
</files>

<files categories_recyclebin.php>
order allow,deny
deny from all
</files>

<files contact_management.php>
order allow,deny
deny from all
</files>

<files contact_recyclebin.php>
order allow,deny
deny from all
</files>

ErrorDocument 404 /404.html