Mod-Rewrite question

Posted on 2011-10-14
Last Modified: 2012-06-22
I want to hide file extensions and add a trailing slash to the url e.g.

My current htaccess looks like this:

Options +FollowSymLinks
RewriteEngine on
rewriteCond %{HTTP_HOST} ^ [NC]
rewriteRule ^(.*)$$1 [L,R=301]
RewriteRule (.*)/(.*)-(.*)-(.*)-(.*)\.html$ /details.cfm?ListId=$1&StrNumber=$2&StrName=$3&Cty=$4
RewriteRule ^(.*)\.html$ $1.cfm [nc]

Need help figuring this out! any help appreciated!
Question by:Bang-O-Matic
    LVL 10

    Expert Comment

    are all your extentions the same? (.cfm)?

    Author Comment

    yes they are all .cfm files
    LVL 10

    Accepted Solution

    Try this:

    RedirectMatch 301 ^/(.*)\.cmf$$1/

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now