title: Do you have to escape a forward slash when using mod_rewrite?
body: <p>With regards to the forward slash "/" when giving a regex to RewriteRule or RewriteCond, or anything else related to .htaccess in particular, is there a need to escape the forward slash?</p>
  
  <p>Here is an example of what I am trying to achieve</p>
  
  <pre><code>RewriteEngine on
  RewriteOptions inherit
  
  RewriteBase /uk-m-directory/
  RewriteRule ^(region|region\/|regions\/)$ regions [R=301,L]
  RewriteRule ^(county|county\/|counties\/)$ counties [R=301,L]
  RewriteRule ^(city|city\/|cities\/)$ cities [R=301,L]
  </code></pre>
  
  <p>The above works fine, and it continues to work fine when I remove the backslashes as shown below</p>
  
  <pre><code>RewriteEngine on
  RewriteOptions inherit
  
  RewriteBase /uk-m-directory/
  RewriteRule ^(region|region/|regions/)$ regions [R=301,L]
  RewriteRule ^(county|county/|counties/)$ counties [R=301,L]
  RewriteRule ^(city|city/|cities/)$ cities [R=301,L]
  </code></pre>
  
  <p>Which one is the correct way? Are they both wrong?
  Is there any special reason the forward slash should be escaped, or shouldn't?</p>
  
  <p>My guess is that the forward slash does not need to be escaped because it isn't a special character, as far as I know. But I just want to be sure.</p>
  
  <p>In case you're wondering the point of this code, it redirects city, county, and region (with or without a forward slash) to their plural equivalents. Furthermore if the plural has a forward slash it removes the forward slash.</p>