Re: Passing Variable in URL

2 views
Skip to first unread message
Message has been deleted

Phil Cruz

unread,
Jun 23, 2005, 2:09:27 AM6/23/05
to cfever...@googlegroups.com
This isn't specific to cfeverywhere.  You'll probably get a better response on CF-Talk (or searching the CF-Talk archives)...

On 6/22/05, Daryl <dcum...@ucsd.edu> wrote:

Search engines typically don't pick up pages that pass variables in
them.  I'm trying to make it so the "?" in " index.cfm?blah" doesn't
appear.  Here is the code I've been tweaking with no success.

REReplaceNoCase('.+\index.cfm/?','.+\index.cfm/?','index.cfm', 'ALL'):


<CFOUTPUT>
#REReplaceNoCase('.+\index.cfm/?','.+\index.cfm/?',' index.cfm', 'ALL')#
</CFOUTPUT>

Does anyone have any ideas?

Thanks!
Dary


Daryl

unread,
Jun 23, 2005, 10:50:18 AM6/23/05
to cfever...@googlegroups.com
Thanks. I figured that out and reposted elsewhere.

charlie arehart

unread,
Jun 23, 2005, 11:36:11 AM6/23/05
to cfever...@googlegroups.com
Yes, look for discussions of ses (or search engine safe) URLS, or seo (search engine optimization).
 
I'd like to point out a couple things you won't see in those discussions, though. For those using BlueDragon (with CFeverywhere or otherwise), we have something CF does not. In BD, the application.cfm will run *whether the file requested in the URL exists or not*.
 
This discussion from the Enhancements Guide may be more useful.
5.4.1 Application.cfm Processed Even When Requested Template Does Not Exist
 
BlueDragon offers an enhancement whereby if a URL requests a file that does not exist, Application.cfm is still processed before rejecting the request as a file not found, so that processing can take place that redirects based on the requested URL. This has an important advantage over CFMX, especially in the way of creating search-engine safe URLs or otherwise hiding the technology behind your site.
 
As an example, the sites Blog-City.com and LinuxWorld.com both use URLs such as the following to request CFML-driven pages. Notice that it’s a request for an HTM file:
 
In this case, the file 789800.htm doesn't physically exist. The only file in the read directory is Application.cfm. When that request is processed, BlueDragon runs the Application.cfm which in their code then parses the cgi.script-name looking for the filename ('789800') and then makes a decision on that (such as pulling a record from a database or such), and then they render the template. At the end of Application.cfm processing, they call <CFABORT> to prevent the user getting a “file not found” error.
Using this technique, they can create very clean URLs without having to resort to complicated REWRITE rules in their web server. Also, using this technique allows them to code to a Model-View-Controller (MVC) paradigm more effectively, with the Application.cfm file being the controller.
One other thing is that, if you really prefer to work with URLs like index.cfm/blah, BlueDragon also supports that differently from CF as well. The information after the slash following a file extension (the /blah, above) is formally known in the HTTP spec as the "path info". CFML has long had a cgi.path_info variable, but for years CF has improperly filled that with the file file name of the page being requested. That's really not what that's for (use cgi.script_name instead). So our path_info will be very useful to SES/SEO processing, if you're really interested in doing it and in changing your code to take advantage of this on BD.  This is covered in our Compatibility Guide (section 3.6).
 
Hope that's helpful.
 
Charlie Arehart
CTO, New Atlanta Communications, makers of BlueDragon
(678) 256-5395 cha...@newatlanta.com
www.newatlanta.com/bluedragon/
 


From: cfever...@googlegroups.com [mailto:cfever...@googlegroups.com] On Behalf Of Phil Cruz
Sent: Thursday, June 23, 2005 2:09 AM
To: cfever...@googlegroups.com
Subject: Re: Passing Variable in URL

Dave Ferguson

unread,
Jun 23, 2005, 11:59:41 AM6/23/05
to cfever...@googlegroups.com
FYI... you can do this with CF. All you have to do is change the
servers 404 handler to be a cfm page instead of displaying a 404
error. This way you can have any url you wish and have CF process it.
Granted you do need access to the web server do perform this.

--Dave
Reply all
Reply to author
Forward
0 new messages