How to set up website aliases
This article explains how to change your website links from dynamical format like www.site.com/?id=12345 to human friendly format like www.site.com/news/
Step 1. Configure your web server
Usually when you type in an URL like www.site.com/news/ the web server will try to find a folder named "news/" in the website folder. When folder exists, then web server displays the index file (index.php, index.html etc) from there or error page "404 document not found" otherwise. To change this default behaviour in your website you have to configure the web server at first. Web server (in this case Apache) should not search for the folder in the filesystem but redirect to a certain page in your website. This is accomplished by using Apache Rewrite module (mod_rewrite).
There are two ways to implement Apache rewrite rules, either in the server configuration file in VirtualHost directive or in the .htaccess file located in the website root folder.
- If you have access to the VirtualHost directive then you must add following rewrite rules for Saurus CMS aliases to work: http://www.saurus.info/configuring-alias-module. Note that you have to restart Apache for these rules to take effect. You may also ask your hosting company to apply thes rules for you.
- If you have access only to .htaccess file then you should use rules described here: http://www.saurus.info/configuring-alias-module-using-htaccess-directives.
Step 2. Check if aliases work on your website
After applying the rewrite rules check if they work correctly:
- Links like www.site.com/12345 (replace 12345 with valid ID value) should display either an article/section page or CMS error page "Not found" (in case no article/section with that ID value were found).
- Links like www.site.com/testalias/ should display CMS error page "Not found".
In case either of those links returns Apache's own white error page "404 document not found", then the rewrite rules have not taken effect yet. You need to check that you have put in the correct rule set - check it over word for word, character for character.
Step 3. Configure alias settings in Saurus CMS
After you have successfully completed previous steps, you need to instruct Saurus CMS to show all website links in human friendly form (as aliases) instead of dynamical form like www.site.com/?id=12345. This is done through the website admin section: open up the "System > Configuration" admin page and locate the "Aliases" block. Set the option "Use static URLs and alias names if available: website/1234 and website/news instead of website/?id=1234" to "Yes".

Optionally you can configure how the aliases will look in your website. If you have website with multiple languages then it may be useful to turn on the language shorthand option for either all languages or only for non-default languages.
Also you can choose between short and long alias format: short format displayes only alias name itself while long format displays entire path of all aliases starting from the homepage.


Click "Save" button to save your changes and check out your site - all the menu item links should look like www.site.com/12345 now. Depending on your configuration there can be language shorthand etc, but the link should not look like www.site.com/?id=12345.
Step 4 (optional). Generate aliases for entire website content
If you have a large website then creating aliases for all sections and articles can be a taunting task. To avoid clicking on every object and manually typing in the alias there is a tool which generates this from the objects title. Open www.site.com/admin/repair_database.php?run=0&type[]=aliases you will see a list of objects that don't have alias defined:

Review the list and if everything seems okay then start alias generating by clicking "Repair database" button. You will see a list of the same objects but now with the generated alias values:

Troubleshooting
- If the website links still look like www.site.com/?id=12345 then try to empty all the caches so that CMS will generate the website pages again. This can be done through site admin section: open up the "Presentation > Page templates" admin page and click the "Clear cache" button and then "Delete" button in the opening popup window.
- If the website links are still wrong after deleting site cache then you should look at the source code of your templates. Make sure the links are displayed by using the Saurus API {$obj->href} attribute and nothing else.
- Check if you have Saurus CMS version 4.5.3 or later
- Check if your Saurus CMS license includes Alias module
