Answer the question
In order to leave comments, you need to log in
How to correctly form a rule for mod_rewrite?
I have a rule for links like ru/catalog/windows/browser
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php/$1/$2/$3/$4
Answer the question
In order to leave comments, you need to log in
God, what the hell did you write?
1. Read up on greedy and lazy quantifiers and you'll know Zen. And that will solve your problem.
2. you don't need to list everything except the slash, because there are OOOOO exceptions [^/]
- this is NOT
www.exlab.net/files/tools/sheets/mod_rewrite/mod_r...
And so
1. Read about lazy quantifiers and put a limit on the third slash . (but this is already a bro level)
well, in your version, put .+
it but not [^/]
, and naturally close it with a slash, in this case everything will be highlighted up to the first slash, and so on.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question