Picked this up off a CF tips page a few months back, haven't ever used
it though...
------------------------------------------------------------------------
----------------
search engine safe URLs
------------------------------------
This is a modified version of a tip Ben Forta has brought up that
basically "tricks" search engines into indexing your CF pages.
Since most search engines typically ignore dynamic sites that use
querystrings in their URLs this code tricks them into seeing a
directory structure rather than a querystring.
Implementing this should be rather painless if you call parameters
in your code as #some_id# and not with the url as #url.some_id#.
So lets say you have a magazine site. And you have interviews on
your site. To view an interview you would link to it with...
http://yourdomain.com/interview.cfm?i_id=26
Search engines wont index that. However they will index...
http://yourdomain.com/interview.cfm/i_id/26
OR
http://yourdomain.com/interview.cfm/i_id/26.html
(both of which will work with the supplied code).
Basically its replacing "?" and "&" and "=" with "/" in the URL.
The code also lets you append .html or .htm to the end of the URL and
just weeds it out on the way in.
In both situations above, calling #i_id# will product 26.
feel free to view saulgoodman.com for a working example of how the URLs
look and act.
do note that this hasn't been tested on all webservers or all versions
of
cf app server. I've only personally tested it on IIS5 (win2k) and
cf app server 4.5.1 pro.
you can build your links as...
/somepage.cfm/section/news/view/#query.column##url_suffix#
Associated Code :
<!--- lets assume we always want to append .html to the end of the URL
as default --->
<cfparam name="url_suffix" default=".html">
<!--- make sure the are at least 2 variables. A name for the paramenter,
and the actual value of the param --->
<cfset length = listlen(cgi.path_info, "/")>
<cfif length GT 2>
<cfset param_name = "">
<!--- check and remove if found .html or .htm --->
<cfif right(cgi.path_info,5) is ".html">
<cfset url_suffix = ".html">
<cfset path_info = removechars(cgi.path_info,
len(cgi.path_info)-4, 5)>
<cfelseif right(cgi.path_info,4) is ".htm">
<cfset url_suffix = ".htm">
<cfset path_info = removechars(cgi.path_info,
len(cgi.path_info)-3, 4)>
<cfelse>
<cfset url_suffix = url_suffix>
<cfset path_info = cgi.path_info>
</cfif>
<!--- loop through all the items in the 'path_info list' and set the
params --->
<cfloop index="x" from="2" to="#length#">
<cfset param_value = listgetat(path_info, x, "/")>
<cfif param_name is "">
<cfset param_name = param_value>
<cfelse>
<cfset setvariable(param_name, param_value)>
<cfset param_name = "">
</cfif>
</cfloop>
</cfif>
Courtesy of : Owen Knapp
------------------------------------------------------------------------
-------------------
-----Original Message-----
From: PLundis [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 11:16 AM
To: cf-talk
Cc: PLundis
Subject: Re: question marks and spiders, e-marketers...
Interested in hearing how anyone has worked the slash game in CF...
ANyone done this?... just looks and sounds much better for all the
spiders, presentation, etc.
-paris
-----Original Message-----
From: Jamie Jackson <[EMAIL PROTECTED]>
Date: Mon, 09 Jul 2001 11:46:37 -0400
Subject: Re: question marks and spiders, e-marketers...
> The last that I heard was that some do, some don't.
>
> Go to Google, and search on "ebags." The second item is a link with a
> question mark (this is a fusebox site). I think that's proof that
> *some do.*
>
> I've heard of some people hacking their Web server (Apache) to
> understand slashes as a replacement to the query string, thus
> imitating directory structure. So instead of
> mydomain.com/index.cfm?key1=val1&key2=val2, you have *something* like
> mydomain.com/key1/val1/key2/val2
>
> I'm certain I have the syntax messed up, but you get the point...
> dynamic links that look like regular directories.
>
> I could have this all wrong, but someone wil correct me.
>
> Jamie
>
> On Tue, 03 Jul 2001 15:50:56 -0400, "Andrea Wasik"
> <[EMAIL PROTECTED]> wrote:
>
> >Hello,
> >
> >I was just told by an emarketing firm that came in to give us a
> >presentation that none of the search engines can spider links that
> >contain question marks. Since we have a site with over 200,000
> dynamic
> >pages, we have question marks EVERYWHERE as we are using CF.
> >
> >Does anyone know about the validity of this claim? Has anyone dealt
> >w/this issue and if so, what did you do? I know one option presented
> to
> >us was making up "traffic" pages that have static links to
> accomodate
> >the search engines - but that are not "real" parts of our site -
> that is
> >another option but I am loathe to even begin to think about ways to
> get
> >rid of all question marks in our site.
> >
> >Thanks,
> >
> >Andrea
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists