Helpful Information
 
 
Category: ColdFusion Development
url rewriting in cold fusion

I wonder if anyone can help me... I work 99% with Apache and php, etc, but have one client who is on Windows and cold fusion. We want to get rid of the query strings on his pages as it is interfering with search engine spiders. I know how to do this on Apache, but havent a clue how to achieve it on a Windows server. I believe it can be done via asp, but we have only cfm and SQL Server I believe... any ideas?

This might help. Basically it takes some changes to IIS before you can make it work I think.

http://www.houseoffusion.com/cf_lists/index.cfm?method=messages&threadid=25342&forumid=4

http://www.houseoffusion.com/cf_lists/index.cfm?method=messages&threadid=25343&forumid=4

Thanks for that kiteless, I have found from researching these links that SES urls can be easily implemented using fusebox. Can fusebox be installed on a (large) existing site without redesigning it, or is it possible to recode the sesconvertor.cfm script to work with the URL scope and bypass fusebox?
So many questions...

No, you can't just slap Fusebox onto an existing site. It must be built using Fusebox; Fusebox is a framework.

You could TRY to modify the SES scripts that are available for Fusebox, but you might just have better luck writing your own. It's really not that hard...everything after the ".cfm" becomes a "/" delimited list of name value pairs, with the first slash in each element translating to "&" and the second slash translating to "=". Parse though it and copy the values into the URL scope, and you're done.

So when I have written a few lines of script that will recreate the correct query string using a regex, do I put this (script) in the top of each file? How does the server then know where to direct the page request to?

The best place to do something like this is in the Application.cfm file. This file is automatically called by the CF server before anything else happens during the request. Just put the file in the root of your application. Put your SES url parsing code in there, and CF will run it prior to any other page that gets called.

I think all is now becoming clear, thank you so much for your patience, I will have a go and see what happens!

I now have a moment to come back to this and am trying to get the requested url into my script. I have this:

<cfif (Len(cgi.request_uri))>
<cfset currentPath = cgi.request_uri>
<cfelseif (Len(cgi.path_info))>
<cfset currentPath = cgi.path_info>
</cfif>
<cfoutput>#currentPath#<br></cfoutput>

which does give me the current path but it strips out the query string... where do I find it??

sorry, forget that, I found it myself in #cgi.query_string#...
Back to the scripting board...

I wonder if anyone can help me... I work 99% with Apache and php, etc, but have one client who is on Windows and cold fusion. We want to get rid of the query strings on his pages as it is interfering with search engine spiders. I know how to do this on Apache, but havent a clue how to achieve it on a Windows server. I believe it can be done via asp, but we have only cfm and SQL Server I believe... any ideas?

I'm using CF and Apache on linux server. How do you get rid of the query string with Apache?

Thanks

I'm using CF and Apache on linux server. How do you get rid of the query string with Apache?

Thanks
mod_rewrite! Absolutely brilliant, -you can do nearly anything except rule the world, be prepared to do a little head work to figuire out the possibilities, start here:
http://httpd.apache.org/docs/mod/mod_rewrite.html










privacy (GDPR)