请帮助我如何创建一个.htaccess文件
index.php?regional=aaa domain.com/aaa/
list.php?regional=aaa&ctg=bbb&orderby=ccc&page=123 domain.com/list/aaa/bbb/ccc/123/
list.php?regional=aaa&ctg=bbb&orderby=ccc domain.com/list/aaa/bbb/ccc/
list.php?regional=aaa&ctg=bbb domain.com/list/aaa/bbb/
detail.php?regional=aaa&ctg=bbb&name=ddd domain.com/detail/aaa/ddd/
答案 0 :(得分:1)
RewriteRule ^([^/]+)/?$ index.php?regional=$1 [NC,L]
RewriteRule ^list/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ list.php?regional=$1&ctg=$2&orderby=$3&page=$4 [NC,L]
RewriteRule ^list/([^/]+)/([^/]+)/([^/]+)/?$ list.php?regional=$1&ctg=$2&orderby=$3 [NC,L]
RewriteRule ^list/([^/]+)/([^/]+)/?$ list.php?regional=$1&ctg=$2 [NC,L]