Please check the following two rule:
RewriteRule ^([^/]*).html$ index.php?s=$1 [QSA,L]
RewriteRule ^([^/]*)\.html$ index.php?s=$1 [QSA,L]
Can you please answer which one is better to use and why? Apparently seems both is working. Thanks.
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.
ok learned a new thing from shashank kadne, that I didn’t thought before. So, basically a dot (.) has its own significance in regular expression and it means “anything”. to make it instruct as only dot, it should be escaped as “.” .
The first rule is wrong. For example, it will allow file.dhtml as a valid rule, which isn’t actually.