urlmod-rewriteconfigurationhttpd.conflampp

How to add code that fixes urls in httpd.conf


So the 'problem' im having is that 192.168.2.69/TEST does work, but when i go to 192.168.2.69/test it doesnt work. also happens with other folders or files. now i had soem type of code that fixed urls and with casing and just wrong writen urls. such as 192.168.2.69/TETS would go to 192.168.2.69/TEST and same for files. though after a reinstall of xampp/lamp it was removed and i wasnt smart enough to think about that code.

btw: im using xampp 8.2.0 on linux (also called lamp) OS = Ubuntu 22.04.1 LTS Desktop

i tried everything, from googling, to asking chatGPT. nothing has worked so far.

I know my code had something to do with the rewrite_module, but i dont know the code itself anymore. and please, do not come up with .htaccess files. i dont like those. i'd rather have code in my /opt/lampp/etc/httpd.conf

Any help is appreciated alot.


Solution

  • I know my code had something to do with the rewrite_module

    The rewrite_module (ie. mod_rewrite) cannot correct arbitrary errors in the URL as you suggest in your examples. mod_rewrite can only correct specific/known errors - but that does not seem to be the case here.

    You are probably looking for the Apache module mod_speling (one l). This can correct case and single character differences in the URL (via an external redirect) when the URL is mapped to the filesystem.

    Once the module is installed, it's simply a matter of enabling the spelling module in order to correct both case and single character differences:

    CheckSpelling On
    

    (Can be set anywhere... server config or .htaccess)

    But note that this does put an additional load on the server and can potentially mask internal errors with URL creation.