I have this regex:
RewriteRule ^www\/login\/?$ login/ [L,NC,R]
What does it do?
I have this regex:
RewriteRule ^www\/login\/?$ login/ [L,NC,R]
What does it do?
This is a rewriting rule that says that the URL started with www / login preceded by / ( forward ) or not, redirect to login /. The flags [L, NC, R] mean:
L is last , that is, in a list of conditions, the conditions below the one with this flag will not be read.
[R] is redirect , this directs the browser to do the redirect. You need to put the full URL.
[NC] is no-case , it only causes comparisons to be made in case-insensitive mode, / p>
I recommend reading the Apache documentation here and also from that related question for more information: Friendly URL, how to do work with HTACCESS .