Friendly URLs

Mon, 22 August, 2011 - 10:49:25

As mentioned in previous posts, I have recently finished working on a multilingual website for a colleague. The website was created using ModX revolution. At the start of the project I would have preferred to use ExpressionEngine, but EE is not free for commercial purposes and paying for a CMS was not an option. The process of creating a new website from scratch and using a new (to me) CMS was both challenging and rewarding. One of the biggest challenges was making the site multilingual. This would require a dynamic approach as I didnt want to have to create three templates for every page. Luckily there are some great developers out there supporting ModX and I found Babel, an add on that did exactly what I wanted. Babel makes it easy for non technical users to add content in multiple languages.
The secondary problem was that I wanted sensible "friendly" URLs. With some help from google and some tinkering with babel and the .htaccess file, I was able to achieve what we wanted. A URL structure that made sense and appeared in the relevant language. This has the advantage of readability and helps the user understand where in the site they are. This also has benefits regarding Search Engine Optimisation as the site's default language is Italian and we wanted Italian google to pick it up. English URLs would not have been preferable.

On finishing the website with its pretty URL structure, I returned to my own site and looked at the mess in the URL bar through new eyes. Individual posts were displayed by id number rather than title and all URLs had an unsightly "index.php?" sitting in the middle.
Luckily EE is well documented and with the new confidence I had gained, I was easily able to modify the .htaccess file to hide the "index.php?". I also realised that the tag I had used for all of the links within the site used the "entry_id_path" tag rather than the "url_title_path". With these two changes made... Behold! Pretty URLs!




Your comment...

Name Email - required, will not be published URL

Notify me of follow-up comments?

Please enter the word you see in the image below: