Apache on CentOS issue configuring routing to "Index.html" (uppercase"I")

76 Views Asked by At

I have a project being deployed such that an Apache instance is running on CentOS (DMZ) which is due to forward all requests to a TOMCAT instance running behind the firewall. For instance, a request:

www.Example.com

needs to be forwarded to:

HTTP://<servername behind the firewall>:<port number>/Blabla/Index.html

(Note that Index.html has a capital I).

I should note that the whole project required extensive review as it was developed under Windows (case insensitive filenames) but the running environment is Linux, and now all filenames and their references are fully synchronized.

The problem appears to be that it is not possible to configure within Apache to forward requests to Index.html and it converts it to index.html, which does not exist.

I can change all the file names to lowercase, but this will take quite some effort.

Is there any way to force Apache to use as-is what I define (i.e. if lowercase, use lowercase; if uppercase, use uppercase; if mixed, use mixed).

Thanks in advance.

2

There are 2 best solutions below

2
R.Dussin On

If you're using virtualhosts, you may add this option into it:

DirectoryIndex Index.html

So your virtualhost should be like that :

<VirtualHost *:80>
    ServerName website_name
    DocumentRoot website_directory
    DirectoryIndex Index.html
</VirtualHost>

You can paste it in /etc/httpd/conf.d/mywebsite.conf and reload apache with :

systemctl reload httpd

If you have CentOS/7. For older versions of CentOS use this command:

service httpd reload
0
mphowarth On

You should be able to use mod_speling from Apache. In your configuration file, simply put:

CheckSpelling On
CheckCaseOnly On

And reload Apache using either:

/etc/init.d/httpd reload

Or if you're using CentOS 7:

systemctl reload httpd

This should now make all the files in your website directory insensitive.