Hello,
This redirect function could come handy to u, if you prefer php redirection.
PHP Code:
function redirect($url){
if (!headers_sent()){ //If headers not sent yet... then do php redirect
header('Location: '.$url); exit;
}else{ //If headers are sent... do java redirect... if java disabled, do html redirect.
echo '<script type="text/javascript">';
echo 'window.location.href="'.$url.'";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>'; exit;
}
}
Uses:
PHP Code:
$redir = "http://yoursite.tld/yourpage.ext";
echo redirect($redir);
As far as I can understand that you are concerning about your page to redirect to the new rules that you created in your .htaccess. you should go for the htaccess codes that ASIFNAYEM gave above. without 301 redirection method, you may face seo problem for duplicate content.
Bookmarks