Solved Make 1 Directory Case-Insensitive

AfterInfinity

Verified User
Joined
Jul 16, 2021
Messages
16
Hey there!

I'm a bit in a dead end I'm not very experienced with OpenLitespeed. I'm sorry if this question is stupid.

So I created a subdomain in DirectAdmin. Let's call the subdomain example and the domain domain.com for simplicity sake.

DirectAdmin automatically creates a directory in the public_html folder of domain.com
That's great as I also want to be able to access it through domain.com/example.

The issue rises when trying to access the subdomain trough domain.com/example when any letter is capitalized.
This is expected behaviour, I know, that's how I want all directories to act except of this one.

How do I go about telling openlitespeed to treat specifically this directory differently, case-insensitive?

Should I change my openlitespeed.conf?

Thank you for your help!
 
You can try to use symlink
Thank you! This was a great temporary solution and worked!

I have finally solved the problem. Or I think I did. Time will tell, haha.

For anyone who's interested:
Yes the solution was to change the openlitespeed.conf.
Changing the file directly will not make the changes permanent, so this had to be done through DirectAdmin GUI.

Navigating to HTTPD Custom Configuration I selected the domain's openlitespeed.conf.
Thereafter (in evo skin) a button called customize will appear next to the openlitespeed.conf.
When the button is pressed there are 8 different "CUSTOM" areas you can edit.
I selected "CUSTOM 5" which adds code in the rewrite section.
Under it you will see a text box where you can enter the code.
Keep in mind this changes all the vhost rewrite sections in the file.
If anyone know how to just add the code in just one or two vhosts please reach out to me in this thread.

Anyway, in this text box I added these lines:
Apache config:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?example/(.*)$ example/$1 [NC,L]
example being the subdomain.

My sources: OpenLiteSpeed - Rewrite rule difference in .htaccess vs VH rewrite tab vs VH context rewrite rules

Kind Regards
 
Back
Top