I was wondering if anyone could explain the syntax, or has found a good tutorial on the syntax used by the mod_rewrite module?
I have looked at various examples and think I know what’s going on, but now that i’m wanting to write my own rules I need to be 100%
I feel the apache documentation while shows you where to the put the code quite well, does nothing for explaining the logic.
Thanks in advance 🙂
The syntax used by ModRewrite to describe URLs and their rewrites use regular expressions. Familiarise yourself with this concept and the rest should follow quite easily.
In general, a rewrite rule has the form
Where
fromis a regular expression matching the source URI andtois the target with optional replacements (these are also described in the reference given above).