Solved

SEO Friendly URL from url variables

Posted on 2014-09-23
16
184 Views
Last Modified: 2014-12-06
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.

http://www.mysite.com/Mysite-Information.cfm?n1=some-part-of-the-page&n2=another-part-of-the-page

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

http://www.mysite.com/some-part-of-the-page/another-part-of-the-page/

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?
0
Comment
Question by:day6
  • 7
  • 7
16 Comments
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
Simplest thing I've found is to use sesConverter http://www.erikv.com/ses/

Then when you create urls either statically

index.cfm/fuseaction/examples.testLink/sky/blue/dirt/brown/grass/green.cfm

 or on the fly

index.cfm/fuseaction/examples.testLink/sky/#url.skyvalue#/dirt/#url.dirtValue#/grass/#url.grassValue#.cfm

they end up being parsed as

index.cfm?fuseaction=examples.testLink&sky=blue&dirt=brown&grass=green

Simple, no need to mess with mod_rewrite
0
 
LVL 1

Author Comment

by:day6
Comment Utility
Sidfishes

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.
0
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
You write all of your urls like so

index.cfm/sky/blue.cfm

or generate them with variables

index.cfm/sky/#variables.colour#.cfm

the sesConverter parses that into "proper" url parameters

index.cfm?sky=blue

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

site.com/dir/subdir/index.cfm?sky=blue

site.com/dir/subdir/index.cfm/sky/blue.html
0
 
LVL 1

Author Comment

by:day6
Comment Utility
So in my case, if my cold fusion script generates a url like

page.cfm?urlvar=#url.var1#&urlvar2=#url.var2#

You're saying I hard code in the script

page.cfm/#url.var1#/#url.var2#

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?
0
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
Almost

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)

page.cfm/urlvar/#url.var1#/urlvar2/#url.var2#

and pass it on to the CF engine as

page.cfm?urlvar=#url.var1#&urlvar2=#url.var2#

Your users  (and search engines) will see

page.cfm/urlvar/value1/urlvar2/value2

You place this in the application.cfc OnRequestStart section and it handles all the conversion before passing on so the variables can be set.
0
 
LVL 1

Author Comment

by:day6
Comment Utility
but isn't the point of clean URL remove the url.variable in the URL itself? I mean, at present, if I have

ABC-Company.cfm?var1=About-Us-Page&var2=Staff-Directory

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.
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
Comment Utility
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

example.com/index.cfm?var1=About-Us-Page&var2=Staff-Directory

becomes

example.com/staffdirectory

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:
http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

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

But again that's not a CF solution.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:day6
Comment Utility
I never received a Cold Fusion response on this
0
 
LVL 1

Author Comment

by:day6
Comment Utility
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
0
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
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.
0
 
LVL 1

Author Comment

by:day6
Comment Utility
Sidfishes,

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.
0
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
Yes well that's NOT possible using just CF. As I said, you need to look at mod_rewrite to do what you want.
0
 
LVL 1

Author Comment

by:day6
Comment Utility
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.
0
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Read about how to approach blogging and about ways to do it right. Stand out from the crowd and let your knowledge be consumed by a large audience. This article aims to explain how your blog should look like,  the most important things to do while b…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now