Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    That log snippet isn’t for a request matching the regexp, so it’s not helpful. Rules are applied to all requests. When there is not a match, it’s “passed through” to the next rule.

    I think a problem with your regexp is the match all lazy modifier .*? isn’t doing what you expect. I suggest instead excluding the / from possible matches like so: [^/]*.

    Thus ^business-directory/[^/]*/([^/]*)(/[^/]+)?$

    If the first element after business-directory/ is always numeric, consider [0-9]* or even [0-9]{2} if it’s always two digits.

    While it’s not specific for .htaccess, you could use a tool like the one at regexr.com to test regexp expressions. There you could see how your regexp doesn’t work as expected.

Viewing 1 replies (of 1 total)
  • The topic ‘Apache Mod_Rewrite not being applied correctly’ is closed to new replies.