Redirect is a very powerful feature in PHP but if it is not implemented properly it can be very dangerous.
Generally, there are two ways to redirect in PHP
header()
The most common redirect is using the header() function. This is a builtin PHP function that sends raw HTTP header to the client
The Syntex
header( $header, $replace, $http_response_code);
$header = This parameter represents header string
$replace = This parameter represents new header value
$http_response_code = This parameter represents HTTP response code.
The complete example will be
<?php
header("Location: https://www.naveedulhaq.com");
exit;
?>
After the header, you should use exit or die. This is because bots and crawlers can ignore headers and they still can access the page that you want to protect using header redirect. So to stop processing you should append die() or exit() after you redirect.
My programmer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the costs.
But he’s tryiong none the less. I’ve been using Movable-type on numerous websites
for about a year and am concerned about switching to another platform.
I have heard great things about blogengine.net. Is there
a way I can transfer all my wordpress posts into it?
Any help would be greatly appreciated!
You can easily create a migration script.