2

In my CMS I've made a style adaptation in PHP code.

<img src="/var/thumbs<?= $next_page_url ?>.JPG" height="50" alt="Next">

There are the following phenomenon:

If a file name has both uppercase and lowercase letters (PIC123a.jpg), it does not work. If a file name only uppercase (PIC123.JPG) or only lowercase (pic-test.jpg) it worked.

If I use the entries in the .htaccess it also works with mixed uppercase and lowercase letters.

<IfModule mod_speling.c>
  CheckCaseOnly On
  CheckSpelling On
</IfModule>

But I want to know why it will not work without these .htaccess entries, respectively with only uppercase or only lowercase.

PS: The CMS have only the var $next_page_url, not $next_page_item. I don't want to make too many PHP hacks.

--- EDIT --- More Infos ---

Without the htaccess entry:

If the file extension uppercase AND the file name uppercase (PIC123.JPG) = it works

If the file extension lowercase AND the file name lowercase (pic-test.jpg) = it works

If the file extension lowercase AND the file name has uppercase (PIC123.jpg) = don't work

simfu
  • 61
  • 8
  • [read this post](http://stackoverflow.com/questions/16579652/htaccess-case-sensitive-and-mod-rewrite) – Martin Jul 06 '16 at 22:03
  • @Martin there is nothing wrong with using the short echo tag `=`. Even if short tags are disabled (``), the short echo is still enabled. And it wouldn't mater if there was a space after the `=`. That would make no difference, space or not, as whitespace within php code and around variables, strings, etc is ignored. – Jonathan Kuhn Jul 06 '16 at 22:18
  • I have [QSA, L, NC] inserted, without success. php short_tag is enabled. There isn't the problem. – simfu Jul 06 '16 at 22:39

1 Answers1

2

Whenever you're hitting a url it means you're hitting a server like apache or nginx . php itself is not a server . it just process requests btu those requests are firstly handled by web servers like apache or nginx

The CheckSpelling operative makes Apache perform a more involved effort to find a match e.g. correcting common spelling mistakes

So that is why this chunk of code is used to do the task

<IfModule mod_speling.c>
  CheckCaseOnly On
  CheckSpelling On
</IfModule>

Get it? :)

Happy codding!

Aniruddha Chakraborty
  • 1,849
  • 1
  • 20
  • 32