Partial UPPERCASE and lowercase cause URLs not going to the same place?

I work for an organization with a content management server that was newly switched to Apache. I don't know what it was running before, but I am unsure why the following is happening and how to fix it now that the switch has occurred. Let me show the problem:

URL 1: http://example.org/1234EN.pdf

URL 2: http://example.org/1234en.pdf

1234 is the number of a specific form and the EN (or en) portion denotes the language the form is in, in this case, English. The problem is that URL 1 goes to the specific form, but URL 2 doesn't go anywhere. To solve for this easy to make error, I don't want to create and have to maintain two versions of the same form, one for each URL, because the content of the form often changes and both versions would need then to be updated for each URL. Additionally, customers also don't want to own up to user error and some can't be convinced to type in the UPERCASE portion.

Is there a way to solve this problem? Redirects? Or is there a way to make Apache convert the lowercase suffix at the end go to the UPPERCASE version of the form?

0
задан 13 July 2018 в 10:06
1 ответ

НЕКОТОРЫЕ ЭТО ТАКОЕ ЖИЗНЬ намного легче, когда вы можете игнорировать ЗАМЕТКУ, СТОИМОСТЬ УПРАВЛЕНИЯ САМОМ, ПРАВО?

Исторически:Например, файловая система Windows FAT32 сохранила регистр, но была нечувствительна к регистру, и при открытии файла вам не нужно использовать тот же регистр, который использовался для создания файла, в отличие от Linux. В lLinux вы должны использовать точный регистр.

Но вы можете использовать Apache mod_speling с подходящим названием для адаптации поведения Apache так, как будто файловая система нечувствительна к регистру https://httpd.apache.org/docs/2.4/mod/mod_speling.html

<Directory /var/www/html>
    CheckCaseOnly on
    CheckSpelling on
</Directory>
3
ответ дан 4 December 2019 в 12:17

Теги

Похожие вопросы