This article describes how to enable and configure the mod_speling Apache module on an unmanaged server. The mod_speling module enables your web site to process filenames that vary in their case.
These types of issues can occur with files created on an operating system that uses a case-insensitive file system, such as Microsoft Windows.
A2 Hosting servers run Linux, which has a case-sensitive file system. In other words, file.html and File.html are not the same file. This is different from Microsoft Windows, which does not have a case-sensitive file system. On Microsoft Windows, file.html, File.html, FILE.HTML, and FiLe.Html all refer to the same file.
These file handling differences can cause problems, particularly when:
You can use the Apache web server's mod_speling module to work around these issues. (The module's name is intentionally misspelled with only one 'l'.) With the mod_speling module, you can instruct Apache to ignore filename case. This saves you the effort of having to manually rename files and edit HTML hyperlinks so they all use the correct case.
To set up the mod_speling module, follow the appropriate procedure below for your server's Linux distribution.
To enable the mod_speling module on Debian or Ubuntu, follow these steps:
a2enmod speling
Type the following command to restart Apache:
service apache2 restart
The mod_speling module is now enabled. You can use .htaccess directives to control which directories use it to process filenames. To do this, follow these steps:
cd /etc/apache2/sites-available
To load the new site configuration, type the following command. Replace sitename with the name of your own site configuration file:
a2ensite sitename
Create an .htaccess file that includes the following lines:
<IfModule mod_speling.c> CheckCaseOnly on CheckSpelling on </IfModule>
To enable the mod_speling module on AlmaLinux or Fedora, follow these steps:
httpd -M | grep speling
speling_module (shared)
If you do not see this output, add the following line to the /etc/httpd/conf/httpd.conf file:
LoadModule speling_module modules/mod_speling.so
Then type the following command:
service httpd restart
When the mod_speling module is enabled, you can use .htaccess directives to control which directories use it to process filenames. To do this, follow these steps:
service httpd restart
Create an .htaccess file that includes the following lines:
<IfModule mod_speling.c> CheckCaseOnly on CheckSpelling on </IfModule>
For other Linux distributions, consult its documentation for the steps to enable and configure the mod_speling module.
To view the official Apache documentation for the mod_speling module, please visit https://httpd.apache.org/docs/2.2/mod/mod_speling.html.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.