<FilesMatch "\.(bak|inc|lib|sh|tpl|lbi|dwt)$">
    order deny,allow
    deny from all
</FilesMatch>

RewriteEngine On
#RewriteBase /

# direct one-word access

RewriteRule ^(article)_(list)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2&tid=$3 [QSA,L]

RewriteRule ^(special)_(list)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2&sid=$3 [QSA,L]

RewriteRule ^(article)_(read)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&did=$3 [QSA,L]

RewriteRule ^(form)_([a-zA-Z]+)_([0-9]+)\.([a-zA-Z]+)$      index\.php\?ac=$1&at=$2&fgid=$3 [QSA,L]

RewriteRule ^(forum)_(list)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2&btid=$3 [QSA,L]

RewriteRule ^(forum)_(read)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2&bid=$3 [QSA,L]

RewriteRule ^(forum)_(add)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&btid=$3 [QSA,L]

RewriteRule ^([a-zA-Z]+)_([a-zA-Z]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2 [QSA,L]

RewriteRule ^(public)_([a-zA-Z]+)_([\.0-9a-zA-Z]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&rd=$3 [QSA,L]

RewriteRule ^(order)_([a-zA-Z]+)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&did=$3 [QSA,L]

RewriteRule ^(ordermain)_(list)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2 [QSA,L]

RewriteRule ^(ordermain)_([a-zA-Z]+)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&oid=$3 [QSA,L]

RewriteRule ^(forummain)_(list)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2 [QSA,L]

RewriteRule ^(forummain)_([a-zA-Z]+)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&bid=$3 [QSA,L]

RewriteRule ^(enquiry)_([a-zA-Z]+)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&did=$3 [QSA,L]

RewriteRule ^(enquirymain)_(list)_([0-9]+)[_]*([0-9]*)\.([a-zA-Z]+)$       index\.php\?page=$4&ac=$1&at=$2 [QSA,L]

RewriteRule ^(enquirymain)_([a-zA-Z]+)_([0-9]+)\.([a-zA-Z]+)$       index\.php\?ac=$1&at=$2&eid=$3 [QSA,L]


RewriteRule ^hotel/map\.html$       index.php?ac=hotel&at=hotelmap [QSA,L]

RewriteRule ^hotel/chain\.html$       index.php?ac=hotel&at=hotelchain [QSA,L]

RewriteRule ^hotel/contrast_([a-zA-Z,0-9]+)\.html$       index.php?ac=hotel&at=contrast&hid=$1 [QSA,L]

RewriteRule ^hotel/(h\d+t\d+)\.html$       index.php?ac=hotel&at=hotelshow&hid=$1 [QSA,L]

RewriteRule ^hotel/(h\d+t\d+)_(\d{4}\-\d{1,2}\-\d{1,2})_(\d{4}\-\d{1,2}\-\d{1,2})\.html$       index.php?ac=hotel&at=hotelshow&hid=$1&tm1=$2&tm2=$3 [QSA,L]

RewriteRule ^hotel/order\.html$       index.php?ac=order&at=hotelorder [QSA,L]

RewriteRule ^article/commentsave\.html$       index.php?ac=article&at=commentsave [QSA,L]

RewriteRule ^article/comment\.html$       index.php?ac=article&at=comment [QSA,L]

RewriteRule ^article/comment_([0-9]+)\.html$       index.php?ac=article&at=comment&page=$1 [QSA,L]

RewriteRule ^article/comment_(h\d+t\d+)_([^_]+)_([0-9]+)\.html$       index.php?ac=article&at=comment&hid=$1&hname=$2&cityid=$3 [QSA,L]

RewriteRule ^friendlink\.html$       index.php?ac=public&at=friend [QSA,L]

RewriteRule ^hotel/city_([^_]+)\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1 [QSA,L]

RewriteRule ^hotel/city_([^_]+)_(\d{4}\-\d{1,2}\-\d{1,2})_(\d{4}\-\d{1,2}\-\d{1,2})\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1&tm1=$2&tm2=$3 [QSA,L]

RewriteRule ^hotel/district_([^_]+)_([^_]+)?_([0-9]+)_([0-9]+)\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1&districtCode=$2&simple=$3&pageIndex=$4 [QSA,L]

RewriteRule ^hotel/district_([^_]+)_([^_]+)?_([0-9]+)_([0-9]+)_([0-9]+)?_(\d{4}\-\d{1,2}\-\d{1,2})_(\d{4}\-\d{1,2}\-\d{1,2})\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1&districtCode=$2&businessZoneCode=$3&simple=$4&pageIndex=$5&tm1=$6&tm2=$7 [QSA,L]

RewriteRule ^hotel/business_([^_]+)_([^_]+)?_([0-9]+)_([0-9]+)\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1&businessZoneCode=$2&simple=$3&pageIndex=$4 [QSA,L]

RewriteRule ^hotel/business_([^_]+)_([^_]+)?_([0-9]+)_([0-9]+)_(\d{4}\-\d{1,2}\-\d{1,2})_(\d{4}\-\d{1,2}\-\d{1,2})\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1&businessZoneCode=$2&simple=$3&pageIndex=$4&tm1=$5&tm2=$6 [QSA,L]

RewriteRule ^hotel/chain_([^_]+)_([^_]+)\.html$       index.php?ac=hotel&at=hotelsearch&cityid=$1&chainBrands=$2 [QSA,L]