# Using the mod_speling Apache module

> Use the Apache mod_speling module to fix URL case mismatches and small filename typos, for example after a migration.

Source: https://helpcenter.ruachost.com/developers/web-servers/using-the-mod-speling-apache-module/

The **mod_speling** module in Apache helps correct minor filename errors in URLs, such as case mismatches or small typos. On **ruachost.com**, enabling this module can improve user experience when migrating sites from case‑insensitive systems (like Windows) to Linux servers.

## Why Use mod_speling?

- Corrects case sensitivity issues (e.g., `File.html` vs. `file.html`).
- Handles minor misspellings in requested filenames.
- Reduces broken links after migrations.
- Saves time by avoiding manual renaming of files and links.

## Enabling mod_speling

### On Debian/Ubuntu

1. Log in via SSH as root.
2. Enable the module:

   ```bash
   a2enmod speling
   ```
3. Restart Apache:

   ```bash
   service apache2 restart
   ```
4. Configure `.htaccess` or site config:

   ```
   
       CheckCaseOnly on
       CheckSpelling on
   
   ```

### On AlmaLinux/Fedora

1. Log in via SSH as root.
2. Verify if the module is loaded:

   ```bash
   httpd -M | grep speling
   ```

   Output should include:

   ```bash
   speling_module (shared)
   ```
3. If not loaded, add this line to `/etc/httpd/conf/httpd.conf`:

   ```
   LoadModule speling_module modules/mod_speling.so
   ```
4. Restart Apache:

   ```bash
   service httpd restart
   ```
5. Configure `.htaccess` or site config as shown above.

## Testing mod_speling

1. Create a file named `test.html`.
2. Access it in your browser using variations like:

   - `Test.html`
   - `TEST.HTML`
   - `test.HTML`
3. Apache should serve the correct file regardless of case.

> **Important Notes:**
- You must have **root access** to enable this module.
- Works best for small typos and case mismatches, not major spelling errors.
- May slightly increase server load since Apache checks for alternatives.
