<?php $FILTERWORDS = array('پدر','مادر'); $redirect = 'http://site.com/khata.html'; $target = explode ( '.' , end ( explode( '/', $_SERVER['REQUEST_URI']) ) ); if ( in_array( $target[0] , $FILTERWORDS )) { if ( ! headers_sent() ) { header('Location: ' . $redirect ); exit; } else { echo "<script type='text/javascript'>window.onload = function () { top.location.href = '" . $redirect . "'; };</script>"; exit; } }