Subsribe to our RSS

latest reactions

Montana Flynn
haha …
some1
Hi, Thank you for help me testing my sit …
metin2 yang
it is very nice …
Tjarko
I would'nt use cfhtmlhead for anything ; …
Sebastiaan
Hi Tjarko,Would you suggest injecting…

Use OpenDNS

mxna feeds

A Special ColdFusion Builder Event in Tampa, FLColdFusion Contract Job in Marbella, SpainColdFusion Job Opportunity in West London, United KingdomColdFusion Job Opportunity in Bethesda, MDColdFusion Job Opportunity in Springfield, MOColdFusion Job Opportunity in Seattle, WAColdFusion Builder - RefactoringColdFusion Job Opportunity in Raleigh, NCColdFusion Job Opportunity in Quincy, MAColdFusion Job Opportunity in Memphis, TNColdFusion Job Opportunity in San Antonio, TXUsing Base64 Canvas Data In jQuery To Create ColdFusion ImagesMy move from using cfhttp and rssatom.cfc to cffeed.Infinite entities, cfgrid and one cfc to handle the dataJob: ColdFusion Developer - Marbella, Spain

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2010 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos GallupaPowered by ColdFusion MX

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

5494 viewed | Your opinion...  | del.icio.us | Digg it | Tjarko @ 11/06/07 11:02 cet


Reactions:

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!