Forum Moderators: phranque
RewriteRule ^([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9]+)-([a-zA-Z0-9_\-]+)-([a-zA-Z0-9_\-]+)/index.php?$ index.php?sec=$1&cat=$2&cat1=$3&cat2=$4&cat=$2
I have basically got a problem with the last part
/([a-zA-Z0-9]+)-([a-zA-Z0-9_\-]+)-([a-zA-Z0-9_\-]+)/
This rule cannot use 3 variables in the last part separated by a hyphen.
It works if I use a underscore to separate the last part, however I would rather avoid using underscores or anything other than a slash.
Is it normal to have problems doing this type of thing with rewrite rules?
^([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9]+)-([a-zA-Z0-9_\-]+)-([a-zA-Z0-9_\-]+)/index.php?$ ^([a-z0-9_\-]+)/([a-z0-9_\-]+)/([a-z0-9]+)-([a-z0-9_\-]+)-([a-z0-9_\-]+)/index.php?$ Now take the hyphens out of the two final groups:
^([a-z0-9_\-]+)/([a-z0-9_\-]+)/([a-z0-9]+)-([a-z0-9_]+)-([a-z0-9_]+)/index.php?$ See if that works any better.
The final "?" in your pattern makes the last "p" on ".php" optional. That is, the pattern will match "...index.php" or "...index.ph". Is that really what you wanted?
Jim