Mobile app version of vmapp.org
Login or Join
Megan663

: You can have optional parts, if your PHP script accepts an empty size parameter and then does what you want. Try this: RewriteRule ^catalog/[a-z0-9_-]+-([0-9]+)/[a-z0-9_-]+-([0-9]+)/([a-z0-9_-]+-([0-9]+)/)?

@Megan663

You can have optional parts, if your PHP script accepts an empty size parameter and then does what you want.

Try this:

RewriteRule ^catalog/[a-z0-9_-]+-([0-9]+)/[a-z0-9_-]+-([0-9]+)/([a-z0-9_-]+-([0-9]+)/)? index.php?act=catalog&category=&color=&size= [NC,L]


The important changes are one more parenthesized group, followed by an ? (to make it optional), and an adaption of the capture number from to (since the capturing group for the size is now the 4th one). (Instead of the number change we could also have used (?: instead of the added (, I guess.)

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Megan663

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme