0

I have been googling and stackoverflowing, but I couldn't seem to find any answer as people have the exact opposite problem. I have .htaccess:

RewriteRule ^tag/([^/]+)/?$ index.php?tag=$1 [QSA,L]
RewriteRule ^w/([^/]+)?$ w.php?post=$1 [QSA,L]

And php code:

$unique = $_GET["post"];

followed by a mySQL query and more php code. The problem I am facing here is that no matter if I use *.com/w/AAAAAA or *.com/w/aaaaaa, the outcome is the same. The script will find AAAAAA in the database and display the post. Is there a way of making all this case sensitive?

Preethi Kumar
  • 1,371
  • 1
  • 9
  • 16
Ivan Venediktov
  • 426
  • 2
  • 15
  • 1
    You need to narrow down your problem, are you sure it is related to the url or is it perhaps related to the database itself? – jeroen Jan 27 '15 at 14:05
  • That is probably the problem, I am unable to identify the source. I have been researching mysql case-sensitivity of tables, but I can only find documentation related to various servers and os. – Ivan Venediktov Jan 27 '15 at 14:07
  • 4
    mysql is case insensitive, UNLESS you force a `binary` comparison or are using a non-case-sensitive collation in your tables/fields. – Marc B Jan 27 '15 at 14:09
  • 2
    Yes, these comments are correct. The issue is that mysql is case insensitive - have a look here for the correct way to query with case sensitivity: http://stackoverflow.com/a/7857705/844726 – swatkins Jan 27 '15 at 14:11
  • @swatkins this totally worked! Thank you! – Ivan Venediktov Jan 27 '15 at 14:13

0 Answers0