#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58

    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?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    This might help. Basically it takes some changes to IIS before you can make it work I think.

    http://www.houseoffusion.com/cf_list...5342&forumid=4

    http://www.houseoffusion.com/cf_list...5343&forumid=4
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    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...
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    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.
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    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?
  10. #6
  11. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    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.
  12. #7
  13. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    I think all is now becoming clear, thank you so much for your patience, I will have a go and see what happens!
  14. #8
  15. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    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??
  16. #9
  17. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    sorry, forget that, I found it myself in #cgi.query_string#...
    Back to the scripting board...
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    7
    Rep Power
    0
    Originally Posted by rolty
    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
  20. #11
  21. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    Originally Posted by mnauta
    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

IMN logo majestic logo threadwatch logo seochat tools logo