Forum Moderators: phranque
1. http:// www.mysite.com/links.php?catname=hello&subname=world&page=1
2. http:// www.mysite.com/links.php?catname=hello&subname=world
3. http:// www.mysite.com/links.php?catname=hello&page=1
4. http:// www.mysite.com/links.php?catname=hello
# 1. if catname,subname, page is requested
RewriteRule ^category/([^/]+)/([^/]+)/page-([^/]+).html$ links.php?catname=$1&subname=$2&page=$3 [nc]
# 2. if both catname and subname is requested
RewriteRule ^category/([^/]+)/([^/]+).html$ links.php?catname=$1&subname=$2 [nc]
# 3. if both catname and page is requested
RewriteRule ^category/([^/]+)/page-([^/]+).html$ links.php?catname=$1&page=$2
# 4. if catname only
RewriteRule ^category/([^/]+).html$ links.php?catname=$1 [nc]
# Was rule #1. catname, subname, page requested
RewriteRule ^category/([^/]+)/([^/]+)/page-([^/.]+)\.html$ links.php?catname=$1&subname=$2&page=$3 [NC,L]
# Was rule #3. both catname and page requested
RewriteRule ^category/([^/]+)/page-([^/.]+)\.html$ links.php?catname=$1&page=$2 [NC,L]
# Was rule #2. both catname and subname requested
RewriteRule ^category/([^/]+)/([^/.]+)\.html$ links.php?catname=$1&subname=$2 [NC,L]
# Was rule #4. catname only
RewriteRule ^category/([^/.]+)\.html$ links.php?catname=$1 [NC,L]