title: .htaccess redirect unless in iframe
body: <p>When creating websites, I like to let my clients view the work in progress. At the moment I do this by uploading their website to a directory, and use .htaccess to password protect that directory. But keeping track of passwords and ensuring the directory is still protected after an update is becoming an issue.</p>
  
  <p>I have now created a user login system for my clients where they can login and be redirected to a preview of their site (in an iframe on the page preview.php?c=clientName).</p>
  
  <p>I have looked into various ways of redirecting the client site to the preview page and the easiest has been using .htaccess, but this redirect still affects the site when in an iframe.</p>
  
  <p>Is there any way to stop the .htaccess redirect when the site is in an iframe?</p>