DelphiFAQ Home Search:

Framebusting (reload a framed page outside the frame)

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:

I noticed that some web sites like www.about.com include some articles off my web sites in a frame. I'd like to detect this and reload my article so that my domain name shows in the browser's address bar. How can I break out of those frames?

Answer:

Many webmasters use Javascript which is executed in the user's browser to do this. The following Javascript will do the trick. Make sure to place it in the HEAD section before the BODY tag. That way the page gets reloaded before the whole page has been loaded.

<script type="text/javascript">
if( window!= window.top ) { top.location.href = location.href; }
</script>


If you work with Apache and have access to the .htaccess file, you can use the rewrite engine in Apache. Put the following code in your .htaccess file (and replace delphifaq.com with your domain name, of course):


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^delphifaq.com
RewriteRule ^(.*)$ http://www.delphifaq.com/$1 [R=301,L]



Content-type: text/html

Comments:

2007-11-02, 13:20:08
anonymous from Canada  
2015-05-10, 11:02:56
anonymous from Indonesia  
Saya ingin mengucapkan banyak terima kasih Allah SWT khususnya kepada KI PRAKOSO atas bantuan yang di berikan kepada saya.. Angka Ritual Ghoib Aki Benar-benar Tembus 100%…mohon ma’af Ki Prakoso ini pengalaman saya …waktu itu pernah saya meminta bantuan kepada seseorang yg mengaku pintar meramal angka toto…dan saya harus bayar untuk mendapatkan Terima Kasih Ki Prakoso Atas semua yang anda berikan kepada saya…Angka angkanya…sampai2 saya hutang sana , hutang sini…tapi apa yg terjadi…angka yang saya terima tadi gak ada yang keluar…mampus dalam hati kecil saya..gmn saya harus bayar utang yang terlanjur menumpuk…hingga akhirnya saya di kasih info teman untuk mencoba menjadi Member di Ki Prakoso …Alhasil Angka Ritual Ghoib yang Ki Prakoso kirim ternyata Jitu 100%..dan akhirnya terbayar sudah hutang2 saya….ini hanya sekedar pengalaman saya…untuk yang mau mencoba angka ghoib dari Ki Prakoso Silahkan Hub/Sms di 0852 1828 2434 atau KLIK DISINI ..tidak usah ragu-ragu…karena saya udah merasakannya…terima kasih …Salam Bahagia….!!!

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: