In this php trick, I will show you two ways to make redirections. The first will be in PHP using the header function and the second one will use the URL Rewriting using the .htaccess file.
Method #1
This way is dynamic because you can execute a php code before. Be sure that there is no (X)html code or any echo before the redirection:
1
2
3
2
3
<?php
header('Location: http://www.fluxntech.com');
?>
Method #2
This way use URL Rewriting, so you have to create a .htaccess file and he must contain the following code in the beginning:
1
RewriteEngine on
1
RewriteRule ^mypage\.html$ /mypage2.html [R]
I hope this trick will be useful.
0 comments:
Post a Comment