title: how to website only can access from iframe
body: <p>Can anyone please help me? I have these websites: domain.com, domain.com/site2, domain.com/site3,and site4.domain.com.  Site 1,2 and 3 are wordpress and site4 is php website. In site 1(domain.com) I create a side panel and my goal is that when a user accesses all my sites they still can use my side panel, so I embed/iframe site2,3 and 4 on page site 1 using advance iframe pro.  How do I make site 2,3 and 4 only can open or access from site 1?  For example, I iframe/embed site 2 in domain.com/mypage so that when a user opens domain.com/mypage, site 2 will open via iframe. But when a user accesses direcly from domain.com/site2, they will redirect to site1(domain.com/mypage) or they only see blank page. 
  I tried to modify .htaccess as follows:</p>
  
  <pre><code>{
  
  order deny,allow
  deny from all
  allow from domain.com/site2/12345
  
  }
  </code></pre>
  
  <p>and in iframe: <code>[iframe src="domain.com/site2/12345"]</code></p>
  
  <p>but its not working.  When I access direcly using url domain.com/site2 it shows 404 on site1, and when I access directly domain.com/site2/12345  it can open site2, but in iframe it shows 404 site1... (not use https:// whe use https:// it show 404 site1 but when only use www.domain.com/site2/12345 it can open site2)</p>