Start a conversation

Setting up SEO-friendly URLs

We're actively rewriting our user guide, so check back for improved coverage.

This article applies to Kayako Download customers. Kayako OnDemand customers have this configuration taken care of.

By default, URLs to locations in your support center look like this:

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

This URL includes 'index.php?', which is necessary for the helpdesk to know where to send the request, but isn't 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 own web server (rather than Kayako). 

Step one: Edit your helpdesk __swift/config/config.php file 

Locate the following code in your helpdesk config file, located in ./__swift/config/config.php:

define('SWIFT_BASENAME', 'index.php?');

Remove 'index.php?' as value for 'SWIFT_BASENAME', and save the changes:

define('SWIFT_BASENAME', '');

Step two: Configure a rewrite rule in your web server

If you use Apache:

If not already present, create a file called .htaccess in the document root of your helpdesk. See this article to find out more about .htaccess - you may need to perform further configuration to your web server to get it to 'pick up' .htaccess files.

Paste the following into your .htaccess file:

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

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).

Add the following location directive (note that this is the location directive we use on our server - this may vary depending on your own configuration, especially if you have custom apps installed):

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 knowledgebase 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.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Anadi Raj Tiwari

  2. Posted
  3. Updated