Skip to main content
June 4, 2008
Question

hide cfm extention

  • June 4, 2008
  • 2 replies
  • 685 views
Hi is it posible to either hide the cfm extention or maybe get IIS to add it on request.

what i need is if a user types in to browser www.mywebsite.com/sports (this will be a dynamic page created by a user)

then it adds the .cfm to the end

any ideas?
    This topic has been closed for replies.

    2 replies

    Known Participant
    June 4, 2008
    The "correct" way to do this is either with the .htaccess file or something similar which has just escaped my mind completely. This does involve use of some regular expressions to make it work.

    The basic alternative would be to have the page at www.mysite.com/sports/index.cfm when someone goes to www/sports IIS will recognise it as a directory and look for an index.xxx page. You may need to check that IIS will look for .cfm files as default files - if in doubt create an index.htm file if index.cfm doesn't work. Note you'll need to delete the index.htm file off the webserver as it may take precedence over the .cfm file

    Michael
    Inspiring
    June 4, 2008

    Simplest answer is why can't the dynamic page that is created not have
    the .cfm added at that time? This is the way my systems do it.

    There are ways to modify a request after it has been created. There are
    add-on tools that port the Apache mode-rewrite concept to IIS. Things
    can be done with the 404 File Not Found template so that it does
    something with the request before the error is returned to the client.

    A final idea could be to create /sports as a directory. This is how the
    browser would normally see it. Then inside this directory is a default
    file such as index.cfm that is automatically requested by the web server.

    I have never had the need to muck around with the basic HTTP
    request-response cycle like this, but I have read about it before.