Plesk

How to avoid case-sensitive URL’s in a Plesk website?

Question

How to avoid case-sensitive URLs in Plesk when:

Answer

Warning: mod_speling works only for paths which are physically present on a file system and it is not compatible with websites which are using mod_rewrite to process URLs.

Use mod_speling.so Apache module:

Enable this module for a specific domain:

  1. Log into Plesk;

  2. Go to Domains > example.com > Apache & nginx Settings > Additional Apache directives;

  3. Add the following rows to the fields Additional directives for HTTP and Additional directives for HTTPS:

    • For Red Hat-based OSs:

      LoadModule speling_module /usr/lib64/httpd/modules/mod_speling.so
      <IfModule mod_speling.c>
      CheckSpelling On
      CheckCaseOnly On
      </IfModule>


    • For Debian-based OSs:

      LoadModule speling_module /usr/lib/apache2/modules/mod_speling.so
      <IfModule mod_speling.c>
      CheckSpelling On
      CheckCaseOnly On
      </IfModule>

  4. Click OK.

Enable this module for all domains:

  • For Red Hat-based OS's:

    1. Connect to the server via SSH;

    2. Create a backup of the Apache configuration file /etc/httpd/conf/httpd.conf:

      # cp /etc/httpd/conf/httpd.conf{,.bak}

    3. Edit file /etc/httpd/conf/httpd.conf to add the following rows:

      # vi /etc/httpd/conf/httpd.conf
      LoadModule speling_module /usr/lib64/httpd/modules/mod_speling.so
      <IfModule mod_speling.c>
      CheckSpelling On
      CheckCaseOnly On
      </IfModule>

    4. Reload the Apache service:

      # service httpd reload

    5. Make sure that spelling module was loaded:

      # httpd -M | grep speling_module
      speling_module (shared)


  • For Debian-based OS's:

    1. Connect to the server via SSH;

    2. Create a backup of the Apache configuration file /etc/apache2/apache2.conf:

      # cp /etc/apache2/apache2.conf{,.bak}

    3. Edit file /etc/apache2/apache2.conf to add the following rows:

      # vi /etc/apache2/apache2.conf
      LoadModule speling_module /usr/lib/apache2/modules/mod_speling.so
      <IfModule mod_speling.c>
      CheckSpelling On
      CheckCaseOnly On
      </IfModule>

    4. Reload Apache service:

      # service apache2 reload

    5. Make sure that spelling module was loaded:

      # apache2ctl -M | grep speling_module
      speling_module (shared)