I have this line of code:
RewriteRule ^(.*)/$ allcities.php?state=$1 [QSA,L]
Howver how can I change it so it doesn’t rewrite a new directory I have created, such as “admin”. As currently that is being rewritten as well.
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.
You can use
RewriteCondfor that:Note the exclamation mark before the regex on the
RewriteCond. It makes the regex revert its meaning. So in this case, the condition is true, if the request URI does not start with/admin.Please see the mod_rewrite documentation for more information.