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


