SEO Friendly URL from url variables

I'm embarrassed to ask this, but I can't seem to figure out how to transition my website development method of using url variables to dynamically create the page with content but have a SEO friendly URL instead.

As it stands now, I create a template page .cfm where I use the URL variables to populate various sections of the page with dynamic content.

As I've read online, SEO standards would rather I have a subdirectory type URL instead of url variables.

I honestly don't understand how I use the Mysite-Information.cfm template page and populate the content AND still have an SEO friendly URL afterward.

My mind goes back to the old days where I need literal folders on my site directory which contain duplicate versions of the template... which seems highly ridiculous to duplicate the same template over and over again.

What am I missing here? How do I get the SEO friendly URL while not having to deviate from my development method of using CFINCLUDES within the template based on CFIF statements using the URL variables as the trigger to load whatever content?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Simplest thing I've found is to use sesConverter

Then when you create urls either statically


 or on the fly


they end up being parsed as


Simple, no need to mess with mod_rewrite
day6Author Commented:

Honestly, not a clue what you're recommending. I looked at the markup script and don't quite understand what I'm doing here. Does the script simply read the URL that is trying to load and reload it with subdirectories? I don't get it.
You write all of your urls like so


or generate them with variables


the sesConverter parses that into "proper" url parameters


and that is what the webserver actually sees.

Has nothing to do with subdirectories, it's  only dealing with parameters. which is what ses URLs try to handle. Subdirs generally are just written in the url normally since this is a standard part of a url
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

day6Author Commented:
So in my case, if my cold fusion script generates a url like


You're saying I hard code in the script


Then this sesConverter intreprets all the URL calls on the fly and knows to pull in the variables right? I don't understand... does the visitor see the slashes in the URL bar or do they end up seeing the url.var in the url bar?

If you look at the SesConverter code, all it does is parse out the / in the url it receives and replaces it with ?, = and & characters (as well as the "dummy" extension should you decide to use it.)

Takes this coded url  (note that you still need the urlvar & urlvar2 as parameter names in the url)


and pass it on to the CF engine as


Your users  (and search engines) will see


You place this in the application.cfc OnRequestStart section and it handles all the conversion before passing on so the variables can be set.
day6Author Commented:
but isn't the point of clean URL remove the url.variable in the URL itself? I mean, at present, if I have


Doesn't a search engine see

ABC Company / About Us / Staff Directory

And index it based on the hyphenated words while disregarding the &?= signs?

I thought the point of a clean URL was to remove the variable gibberish from the URL string and if this script requires that the actual var1 and var2 remain in the cleaned up URL, wouldn't that be a pointless conversion? It doesn't look clean to have those subdirectories in the URL called /var1/

So I'm not sure I get the point of the script you're recommending. I understand it's like a Replace() function, but from a search engine standpoint, the goal is to remove the funky variable names and characters so the URL has intelligence.

I'm just not getting this.
Well there's 2 levels of SES

The kind that SESConverter gives you is the "clean up" kind, which is somewhat of a legacy from the old days where spiders couldn't deal with parameters well. My reading is that yes, all major search  engine do indeed understand ?var=1 with no issues, but that they often give lower rank to urls with parameters, so there is still some value in the sesConverter scheme

The other level is url rewriting


This is something that has to be done at the webserver level and, while effective can be complex to setup and maintain (and if you're not a regex wiz, good luck)

Both apache & iis7+ can do mod_rewrite

You can see what's involved in setting up a single rule here:

You would need to do that for every set of urls you want to SES-ify.

But again that's not a CF solution.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
day6Author Commented:
I never received a Cold Fusion response on this
day6Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for day6's comment #a40470946

for the following reason:

This question was not answered
Uh...everything I gave you was CF and is in fact the only way to do SES using CF. If that doesn't work for you, as noted,  your option is mod_rewrite.

It might not be the solution you wanted but is not incorrect.
day6Author Commented:

Actually, the solutions you provided do NOT create SEO friendly url's as I requested. They provided a method for doing SEO friendly URL's, but not the route I requested. I do not want to have to reorganize my content into folders for the URL to work and the solutions you showed require me to change my method of site structure. I simply want a way to use what I have as url variables and have a line of code that reloads my page with a SEO friendly URL.
Yes well that's NOT possible using just CF. As I said, you need to look at mod_rewrite to do what you want.
day6Author Commented:
You provided options that do not address my request. I've posted dozens of questions on here over the years and you've actually provided me answers that have solved my issues. However, on this one, your reply is no different than some other experts on other questions I've asked where they provide a possible method that doesn't resolve my question. It certainly provides me a path to learn new coding techniques etc, but it doesn't solve the seo friendly URL without me manually recreating my site structures... which I specifically said I am not interested in doing. So your suggestions do not provide a solution based on my request. Your defacto statement of there not being a CF method to resolve it is also not 100% accurate since there haven't been any other CF experts provide input yet and this is quite an old question. I will continue to research ideas elsewhere.
Ok, perhaps I was a little inaccurate on the can't be done in CF part. There are ways to do it when using various frameworks that use a single resource point (ie: index.cfm) like FW1, Fusebox, Coldbox etc.

However, what -can't- be done is a simple drop in a block of code & go. The resource pointer methods require using the framework. There are schemes like sesConverter mentioned about which can show the client a ses url but require resource modifications. These are hacks based on the fact that CF application server can modify and pass information about a page to the webserver but the webserver is the only thing that is serving the page. It must know the resource you are trying to access.

What the CF hacks do is intercept the url and format them -back- to what your webserver needs to see to serve the resource.

This is also what mod_rewrite does but since it's integral to the webserver,  it is far more powerful and flexible.

So again, the answer to your question of how to do this without changing your methods is -you can't- with pure CF. Because what ever you do on the CF server is passed to the webserver -you can- do this using mod_rewrite.

I might point out that the reason you haven't found a google search for what you are looking for, or additional input here is that the solution you are looking for isn't available.

It can't be done -is- an answer. And based on my 15+ years of working with CF, I believe that it can't be done.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.