Setting up SEO-friendly URLs

This topic describes the process to set up SEO-friendly URLs.

By default, URLs to locations in your Support Center look like this:

https://my.domainname.com/index.php?/Knowledgebase/List

This URLUniform Resource Locator is the address of a web page on the world wide web. includes index.php?, which is necessary for the helpdesk to know where to send the request but is not very attractive to your end-users and it is generally better to have 'clean URLs' listed in search engines.

It is possible to achieve this using functionality called rewrite rules, which are provided by and configured on your web server (rather than GFI HelpDesk).

To set up SEO-friendly URLs, do the following:

  1. Edit your helpdesk __swift/config/config.php file
    1. Locate the following code in your helpdesk config file, located in ./__swift/config/config.php:
    2. define('SWIFT_BASENAME', 'index.php?');
    3. Remove 'index.php?' as value for 'SWIFT_BASENAME', and save the changes
    4. define('SWIFT_BASENAME', '');
  2. Configure a rewrite rule in your web server
  3. If you use Apache:

    1. If not already present, create a file called .htaccess in the document root of your helpdesk.
    2. Paste the following into your .htaccess file:
    3. <IfModule mod_rewrite.c>

      RewriteEngine On

       

      RewriteCond $1!^(admin|api|console|

      favicon\.ico|robots\.txt|sitemap\.xml|

      index\.php|tiny_mce_gzip\.php|cron|onsite|staff|

      rss|setup|visitor|winapp|wallboard|__swift)

      [NC]

      RewriteCond $1

      !\.(jpg|jpeg|png|gif|js|css|htm|html)$ [NC]

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteCond %{REQUEST_FILENAME} !-d

      RewriteRule ^(.*)$ index.php?/$1 [L]

       

      RewriteCond $1 !^(favicon\.ico|robots\.txt|

      sitemap\.xml|index\.php|tiny_mce_gzip\.php|__swift)

      [NC]

      RewriteCond $1 !\.(jpg|jpeg|png|gif|js|css|htm|html)$ [NC]

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteCond %{REQUEST_FILENAME} !-d

      RewriteRule ^([a-zA-Z0-9]*)/(.*)$ $1/index.php?/$2 [L]

      </IfModule>

    If you use nginx:

    1. Open your nginx.conf configuration file (this may be located under /usr/local/nginx/conf/, but it depends how you have configured your nginx web server).
    2. Add the following location directive (note that this is the location directive we use on our server - this may vary depending on your configuration, especially if you have custom apps installed):
    3. location ~

      ^/(admin|api|cron|intranet|rss|setup|

      staff|visitor|winapp|__swift|__

      swift/cache|__swift/onsite|onsite|__

      swift/thirdparty/fusioncharts/Code/FusionCharts|__

      swift/thirdparty/fusioncharts/

      Charts|__swift/themes|__swift/javascript/__

      global/thirdparty/TinyMCE/plugins)(.*)$ {

      try_files $uri $uri/ /$1/index.php?$2;

      }

NOTE:

This is an example of working web server rules/settings that can be used in an ideal server setup to switch to SEO friendly URLs.

If the same rules are not working in your server environment, please contact your web server admin to edit the rules accordingly as we do not provide web server specific support.