I recently found an article online that told me about this:
RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1§ion=$2 [NC]
Only thing that is driving me crazy right now is if I want to be able to have the 2nd directory or not. Like:
RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1§ion=$2 [NC]
RewriteRule ^mock-up/([^/]+) /mock-up/index.php?page=$1 [NC]
But that’s breaking apache… so what to do? Please help, I need to seo for my client and I would prefer not to have to make individual files for this.
The problem is that
mock-up/index.phpis also matched bymock-up/([^/]+). So you need to exclude the target, either directly:Or indirectly:
So try this: