Articles in this section

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

kb: how-to Plesk for Linux ABT: Group A

Applicable to:

  • Plesk for Linux

Question

How to avoid case-sensitive URLs in Plesk when:

  • The file index.html exists under the website example.com home directory;

  • The file index.html is opening correctly via the browser in the following way:

    PLESK_INFO: http://example.com/index.html

    while the opening of

    PLESK_INFO: http://example.com/iNDeX.htML

    leads to the following error

    PLESK_INFO: 404 error (Not Found)

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:

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


    • For Debian-based OSs:

      CONFIG_TEXT: 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)

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.