What does this htaccess regex do?

3

I have this regex:

RewriteRule ^www\/login\/?$ login/ [L,NC,R]

What does it do?

    
asked by anonymous 13.07.2017 / 22:51

1 answer

7

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 .

    
13.07.2017 / 22:55