Redirectmatch from https to http - urgent

Posted on 2004-11-09
Last Modified: 2010-03-04

I have a couple of folders being accessed via https as set by their htaccess files, which both contain the following:

RedirectMatch (.*)$$1

I would like to put a rule in the root folder of the website which ensures all other folders are not accessed via https - to effectively rewrite https to http for all folders apart from ones that contain the above.

OR there might be a couple of rules I can slot into a single htaccess file at the root? I've RTFM and am still scratching my head, I've got people breathing down my neck, please help!

Question by:johnnygri99
    LVL 5

    Accepted Solution

    Use this in your httpd.conf:

            RewriteEngine on
            RewriteCond     %{HTTPS} !off
            RewriteRule   ^/([^/]+)/(.*)$$1/$2 [L]
            RewriteCond     %{HTTPS} off
            RewriteRule   ^/([^/]+)/(.*)$ - [L]
            RewriteCond     %{HTTPS} off
            RewriteRule   ^/(.*)$$1 [L]

    LVL 15

    Expert Comment

    Whoops- strike that - this one hasn't been abandoned - my apologies!!!
    LVL 5

    Expert Comment

    LVL 15

    Expert Comment

    (clearly not enough sleep last night)

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    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…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    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…

    728 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

    21 Experts available now in Live!

    Get 1:1 Help Now