Search code examples
regexapachepcremod-alias

Why double slash dot (ie: \\.) in htaccess regex?


From another answer, this double slash dot is common

RedirectMatch 404 /\\.svn(/|$)

Since we're matching "/.svn" etc., why isn't this a single slash to escape the period?


Solution

  • Double escaping is allowed here but not really required. So both of these rules will work:

    RedirectMatch 410 /\\.svn(/|$)
    

    OR

    RedirectMatch 410 /\.svn(/|$)