DelphiFAQ Home Search:

InterBase, MS-SQL, mysql, Oracle
C#, C++, Delphi, Java,
JavaScript, perl, php, Visual Basic, VBScript
Apache, Network, Shell
Web Publishing
JavaScript, perl CGI, VBScript, Web Hosting
Apache, File Types, Internet Explorer,
Network, Printing, Processes
Outside the Cube
Auto, Computer Hardware,
Finances, Dating Scams,
Household, Male Dating Scammers,
Other Scams, Travel

Featured Article

Framebusting (reload a framed page outside the frame)


I noticed that some web sites like 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?


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!= ) { top.location.href = location.href; }

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 with your domain name, of course):

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

Generated 0:02:56 on Aug 20, 2017