RewriteEngine on
#RewriteCond %{HTTP_HOST} ^yoursite.com$ [NC]
#RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]


DirectoryIndex index.php

 
#index
RewriteRule ^404.html index.php?file=404
RewriteRule ^index.html index.php
 
 #tag
 
RewriteRule ^tag-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=tag&page=1
RewriteRule ^tag-([0-9]{1,})-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=tag&page=$2
#if use tag/,then pls comment top two lines.

#RewriteRule ^tag/tag-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=tag&page=1
#RewriteRule ^tag/tag-([0-9]{1,})-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=tag&page=$2

#RewriteRule ^tag/([a-z0-9A-Z-_]{1,})-([0-9]{1,}).html$ index.php?alias=$1&ifalias=y&file=category&page=2
  #tag/tag-22.html use cate/**.html in last below.


#cate sub
RewriteRule ^category-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=category&page=1
RewriteRule ^category-([0-9]{1,})-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=category&page=$2

#cate detail
RewriteRule ^detail-([0-9]{1,}).html$ index.php?detailid=$1&ifalias=n&file=category





 #link
RewriteRule ^dmlink-([a-z0-9A-Z_]{1,})-([a-z0-9A-Z_]{1,})-([a-z0-9A-Z_]{1,}).html$ index.php?file=$1&alias=$2&page=$3

 

#page
RewriteRule ^page-([0-9]{1,}).html$ index.php?routeid=$1&ifalias=n&file=page&page=1
 

#404 need begin with http://...#
ErrorDocument 404   /404.html



#alias
RewriteRule ^([a-z0-9A-Z-_]{1,})-([0-9]{1,}).html$ index.php?alias=$1&ifalias=y&file=alias&page=$2
RewriteRule ^([a-z0-9A-Z-_]{1,}).html$ index.php?alias=$1&ifalias=y&file=alias&page=1

#add category alias   in url

 #RewriteRule ^([a-z0-9A-Z-_]{1,})/detail-([0-9]{1,}).html$ index.php?detailid=$2&ifalias=n&file=category

 #RewriteRule ^([a-z0-9A-Z-_]{1,})/([a-z0-9A-Z-_]{1,}).html$ index.php?alias=$2&ifalias=y&file=category&page=1



  
  #multi-----------------
 
#RewriteRule ^cn/$  404.html

#RewriteRule ^([a-z0-9A-Z_]{1,})/dmpostform.php  dmpostform.php?lang=$1
#dmpostform.php not add ?lang=$1,bec will affect get var.

RewriteRule ^([a-z0-9A-Z_]{1,})$  $1/index.html
RewriteRule ^([a-z0-9A-Z_]{1,})/$  $1/index.html
RewriteRule ^([a-z0-9A-Z_]{1,})/index.php$  $1/index.html
 
RewriteRule ^([a-z0-9A-Z_]{1,})/index.html index.php?alias=index&ifalias=y&file=alias&page=1&lang=$1
RewriteRule ^([a-z0-9A-Z_]{1,})/page-([0-9]{1,}).html$ index.php?routeid=$2&ifalias=n&file=page&page=1&lang=$1

RewriteRule ^([a-z0-9A-Z_]{1,})/baidumap.html$ index.php?routeid=$1&ifalias=n&file=baidumap&page=1

#tag
RewriteRule ^([a-z0-9A-Z_]{1,})/tag-([0-9]{1,}).html$ index.php?routeid=$2&ifalias=n&file=tag&page=1&lang=$1
RewriteRule ^([a-z0-9A-Z_]{1,})/tag-([0-9]{1,})-([0-9]{1,}).html$ index.php?routeid=$2&ifalias=n&file=tag&page=$3&lang=$1

#link
#RewriteRule ^([a-z0-9A-Z_]{1,})/dmlink-([a-z0-9A-Z_]{1,})-([a-z0-9A-Z_]{1,})-([a-z0-9A-Z_]{1,}).html$ index.php?file=$2&alias=$3&page=$4&lang=$1

#cate sub
RewriteRule ^([a-z0-9A-Z_]{1,})/category-([0-9]{1,}).html$ index.php?routeid=$2&ifalias=n&file=category&page=1&lang=$1
RewriteRule ^([a-z0-9A-Z_]{1,})/category-([0-9]{1,})-([0-9]{1,}).html$ index.php?routeid=$2&ifalias=n&file=category&page=$3&lang=$1
#cate detail
RewriteRule ^([a-z0-9A-Z_]{1,})/detail-([0-9]{1,}).html$ index.php?detailid=$2&ifalias=n&file=category&lang=$1


#alias
#RewriteRule ^([a-z0-9A-Z_]{1,})/([a-z0-9A-Z_]{1,}).html$ index.php?alias=$2&ifalias=y&file=alias&page=1&lang=$1
#RewriteRule ^([a-z0-9A-Z_]{1,})/([a-z0-9A-Z_]{1,})-([0-9]{1,}).html$ index.php?alias=$2&ifalias=y&file=alias&page=$3&lang=$1

RewriteRule ^([a-z0-9A-Z_]{1,})/([a-z0-9A-Z-_]{1,})-([0-9]{1,}).html$ index.php?alias=$2&ifalias=y&file=alias&page=$3&lang=$1
RewriteRule ^([a-z0-9A-Z_]{1,})/([a-z0-9A-Z-_]{1,}).html$ index.php?alias=$2&ifalias=y&file=alias&page=1&lang=$1

#end multi-----------------

