- Sunday, 24th August 2008
ADDT (Adobe Dreamweaver Development Toolbox) is an invaluable tool when it comes to developing websites. I have been using this for the majority of my development work as it allows me to start and finish projects in virtually no time at all. When required, I still have to delve into the framework itself to make changes, especially if ADDT is not able to do a few things right out of the box.
The one gripe I have with ADDT is that you cannot create search engine friendly URLs. If you have been visiting my website, you will have noticed that I only recently implemented such URLs on my website. MX Kollection did have an example of a mildly looking friendly URL in the form of http://your_server/your_folder_hierarchy/your_site/includes.php/product. Although it may look sound good, personally to me having something like http://www.grafikkaos.co.uk/index.php/product was not enough as a solution.
My only solution was to look at mod_rewrite. Now there are loads of mod_rewrite tutorials available on the net. Here's a few to get you started:
- http://www.workingwith.me.uk/articles/scripting/mod_rewrite
- http://www.4webhelp.net/tutorials/misc/mod_rewrite.php
- http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/
Mod_rewrite is probably the easiest method you can use to create user friendly urls. But make sure your server has it enabled.
If you are using ADDT's Server Side Includes from List behavior, you will know its pretty easy to add files you want to use and how easy it is to choose your URL parameter. The 2 images below show the current structure in use on my own website as well as the url parameter I use.


Apache's mod_rewrite comes as standard with most Apache hosting accounts, so if you're on shared hosting, you may not need to do anything. If you're managing your own box, then you most likely just have to turn on mod_rewrite. If you are using Apache1, you will need to edit your httpd.conf file and remove the leading '#' from the following lines:
#LoadModule rewrite_module modules/mod_rewrite.so#AddModule mod_rewrite.c
Create an .htaccess File
Create a plaintext file and add the following two lines:
Options +FollowSymLinks
RewriteEngine OnThese lines ensure that mod_rewrite is enabled and active. Save this file as .htaccess. Make sure that you do not accidentally name it .htaccess.txt. (If you’re creating the file in notepad, make sure you select “All Files” from the file type dropdown when saving it. Put this file in the directory with your web application.
I will use 2 examples to convert into friendly URLS.
http://www.testsite.com/index.php?mod=books
For the above, we want our url to look like this: http://www.testsite.com/books/. The Rewrite rule for this would be:
Rewrite ^books/$ /index.php?mod=bookshttp://www.testsite.com/index.php?mod=books&id_book=57
For the above, we want our url to look like this: http://www.testsite.com/books/57/. The Rewrite rule for this would be:
Rewrite ^books/([0-9]+)/$ /index.php?mod=books&id_book=57Now in order to get the kind of urls that I have on my blog, (i.e. http://www.grafikkaos.co.uk/article/58-A-Couple-Of-Useful-Sites/), I have a little tip for you. If you are using a database to store your articles details (i.e. article title), add another field within that database table called article-title-seo or whatever you think is suitable in your situation. It might be extra work especially if you are having to modify your update forms and such but its worth it.
Using the books example from earlier, if the book title was The Adventure Of Blue Carbuncle, our new rule would be:
Rewrite ^books/([0-9]+)-(.*)/$ /index.php?mod=books&id_book=57 [NC, L]
If you were using PHP to create your links, this is what you should normally get:
Please bear in mine that this tutorial is for users of ADDT that want to create URL friendly links. There are better mod_rewrite tutorials on the internet.
Hope this helps all you ADDT users.
- Filed In: ADDT (Kollection) Tutorials & Tips
« Previous Article Next Article »
Related Articles
blog comments powered by Disqus





