Though .htaccess, I want to redirect /page/var1/var2 to ./page.php?var1=var1&var2=var2. This is very easy BUT I want to make it so /page/var1 also redirects to ./page.php?var1=var1 (without having the var2). The only way I'm doing this is:
RewriteRule page/(.*)$ ./page.php?var1=$1
RewriteRule page/(.*)/(.*)$ ./page.php?var1=$1&var2=$2
As you can see it's very redundant, and I have a ton of lines like this, so it gets very messy. Any way to define "optional" parts?