I need to change my .htaccess and there are two lines which I don’t understand.
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
When I should use these lines ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not the place to give a complete tutorial, but here it is in short;
RewriteCond basically means “execute the next RewriteRule only if this is true”. The
!-lpath is the condition that the request is not for a link (!means not,-lmeans link)The RewriteRule basically means that if the request is done that matches
^(.+)$(matches any URL except the server root), it will be rewritten asindex.php?url=$1which means a request forollewill be rewritten asindex.php?url=olle).QSAmeans that if there’s a query string passed with the original URL, it will be appended to the rewrite (olle?p=1will be rewritten asindex.php?url=olle&p=1.Lmeans if the rule matches, don’t process any more RewriteRules below this one.For more complete info on this, follow the links above. The rewrite support can be a bit hard to grasp, but there are quite a few examples on stackoverflow to learn from.