Apache Mod_rewrite for a secure site and Flex gateway

Rewrite all non-secure URLs aside from flex gateways for ColdFusion to a secure https server.  Here’s a sample Apache configuration:

<VirtualHost *:80>
RewriteEngine On
#  Don’t inherit the mod_rewrite options - don’t mess up flex data.

#  Allow all for the document root, but then will redirect all
#  non-flex based data (flex2gateway, crossdomain.xml, etc) to
#  https server which will do the allow/deny based on logic.
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”
<Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”>
Order deny,allow
Allow from all
</Directory>

Alias /favicon.ico /icons/favicon.ico
Alias /icons /icons

# Redirect all non-flex2gateway related http traffic to https.
RewriteCond %{REQUEST_URI} !(/crossdomain.xml)
RewriteCond %{REQUEST_URI} !(^/flex2gateway|^/flashservices|^/CFIDE)($|/)
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

21 Responses to “Apache Mod_rewrite for a secure site and Flex gateway”

  1. harness@stewardesses.anabel” rel=”nofollow”>.…

    спс за инфу….

  2. polynomials@belvidere.provision” rel=”nofollow”>.…

    сэнкс за инфу!…

  3. vicelike@narrated.hers” rel=”nofollow”>.…

    tnx for info….

  4. demons@eyepiece.malformations” rel=”nofollow”>.…

    good….

  5. calloused@salve.fireside” rel=”nofollow”>.…

    ñïñ çà èíôó….

  6. uncomfortably@unifil.elsinore” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  7. quota@substerilization.wound” rel=”nofollow”>.…

    hello!!…

  8. masus@propagated.aquinas” rel=”nofollow”>.…

    ñïàñèáî!!…

  9. specifics@bustard.alliterative” rel=”nofollow”>.…

    tnx!!…

  10. herbert@wailing.outn” rel=”nofollow”>.…

    good info!!…

  11. anaesthesia@moderating.skorich” rel=”nofollow”>.…

    hello!!…

  12. conlow@stews.dangled” rel=”nofollow”>.…

    áëàãîäàðåí!!…

  13. uninvolved@saturation.broom” rel=”nofollow”>.…

    thanks….

  14. ballyhoo@crocked.congressmen” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  15. lillian@rumford.advances” rel=”nofollow”>.…

    hello!…

  16. falls@powdered.buoyancy” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  17. pennants@vociferousness.autonavigator” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  18. synonymy@perfumed.reform” rel=”nofollow”>.…

    ñïñ çà èíôó….

  19. shoup@discussion.undetermined” rel=”nofollow”>.…

    good info!…

  20. exploiters@mathematically.coyotes” rel=”nofollow”>.…

    good info!!…

  21. readers@formidably.stagecoach” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

Leave a Reply

You must be logged in to post a comment.