htaccess explination

can you guys please explain what the following does?

RewriteCond %{QUERY_STRING} !.*track=.*
RewriteCond %{HTTP_COOKIE}  !.*trackc.* [NC]
RewriteCond %{HTTP_USER_AGENT}  !.*(googlebot|msnbot).* [NC]
RewriteRule ^index\.(html|php)$ http://www.domain.com/track/6 [L,R=301]

also what does NC mean and , L, R
LVL 1
AzurewaveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jeremycrussellCommented:
It will redirect a request for http://www.domain.com/index.html or http://www.domain.com/index.php to http://www.domain.com/track/6 as long as the query string (the ?something=something&somethingelse=somethingelse part) doesn't have "track=" in it and as long as the cookie doesn't contain the "trackc" string, and the client isn't a google or msn website crawler.

NC means to ignore case, in other words case insensitive, L means its the Last rewrite rule to follow in a chain and R specifies what code to return for the redirect, in this case a 301 http status code.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AzurewaveAuthor Commented:
Hey there, can you just answer one last thing, what do you mean Last rewrite rule in the chain, if there are more rewrite rules after that it will ignore them?
0
jeremycrussellCommented:
It causes the current request to stop processing the rules.  However, note that at that point, you can sent a redirect to the client, so they make another request that starts to get processed again.  The reason I point this out is that the [L] flag is not something that will close a loop if one is created.  It will simply stop the rule processing and send the current redirect.
0
jeremycrussellCommented:
Not sure what I was doing here, but

"you can sent a redirect to the client, "  should read " the server sends the redirect to the client".
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.