August 14th, 2003, 04:08 AM
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?
August 14th, 2003, 09:28 AM
August 15th, 2003, 05:25 AM
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...
August 15th, 2003, 09:05 AM
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.
August 15th, 2003, 10:55 AM
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?
August 17th, 2003, 02:35 PM
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.
August 18th, 2003, 05:17 AM
I think all is now becoming clear, thank you so much for your patience, I will have a go and see what happens!
August 26th, 2003, 10:59 AM
I now have a moment to come back to this and am trying to get the requested url into my script. I have this:
<cfset currentPath = cgi.request_uri>
<cfset currentPath = cgi.path_info>
which does give me the current path but it strips out the query string... where do I find it??
August 26th, 2003, 12:01 PM
sorry, forget that, I found it myself in #cgi.query_string#...
Back to the scripting board...
March 5th, 2004, 11:53 AM
I'm using CF and Apache on linux server. How do you get rid of the query string with Apache?
Originally Posted by rolty
March 5th, 2004, 12:50 PM
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:
Originally Posted by mnauta