how to get search engine friendly URL's
To get search engine friendly url's you can do a couple of things but one of the most effective ways is having the title of your article / blog as the unique identifier of your message. See the url of this post.The way you can achieve this, is by having the 404 error page in coldfusion handle the request. You can set the 404 page in the ColdFusion Administrator and also in your Apache or IIS setup. Just point to a CFM page that will handle all requests that can't be found on the server.
On this 404 request page you build logic that will take the URL parameters of the variable "CGI.query_string" and pass that to your SQL statement. An example on how I use this on mximize.com
<cfset id = lcase(listLast(cgi.query_string,"/"))>
<cfquery datasource="">
SELECT title, description
FROM article
WHERE art_urlsave = '#variables.id#'
</cfquery> To insert the title as an urlsave value you can use the following bit of code
<cfset art_urlsave = lcase(rereplace(form.art_title, "[^A-Za-z0-9]+", "-", "all"))>
<cfquery datasource="">
INSERT INTO article (art_title, art_urlsave, art_description)
VALUE ('#form.art_title#', '#variables.art_urlsave#', '#form.art_description#')
</cfquery> This way you can point your links to the root of the site with the "art_urlsave" value as your link
<a href="/#art_urlsave#">how to get search...</a> This is the really really short version of how it is implemented, but it's the basics of getting nice search engine friendly URL's. If you have questions just ask them!!
7640 viewed | Your opinion... | del.icio.us | Digg it | Tjarko @ 11/06/07 11:02 cet



