How To Redirect To Other Link
If you are have a link that is too long or if you want to hide some information about that link you can use a simple php to do the redirection. Of course this will work only if your web server supports php scripts. Normally if it is a Linux/Unix type of hosting service than mostly like php scripts are allowed. Please note some Windows server support only asp scripts but not php scripts.
If you have php, this is how it is done:
< ?php
header ("Location: http://www.newwebsite.com/?13234");
exit;
?>
- Copy eveything in the above 4 lines from “< ?php" to "?>“. There should be no space between “<" and "?".
- Don’t use a wordprocessor like MS WORD. Please use a simple text editor, on Windows you can use “notepad”
- Open an empty file in notepad, then paste the text to it.
- Must, must make sure that “< ?php" is at the very beginning of this file.
- Remove the space between “<" and "?". I have added this space to make it possible to show "< ?" here.
- Rename everything after // with the complete URL of the newsite.
- Save the text to a filename with a php extension.
- Upload this file to your server. ( you can use any FTP software to do it).
- That’s all.
IMPORTANT NOTE: “<"MUST be the FIRST character otherwise it would not work. There must not be any space or anything at all in front.
As an example, let say, I would like to redirect a link on my site to www.google.com then:
se1.php contains:
< ?php
header ("Location: http://www.google.com");
exit;
?>
I had uploaded se1.php to www.aukcweb.com/goto/se1.php, it would redirect you to www.google.com whenever you click on this php file.
Try it. www.aukcweb.com/goto/se1.php
Posted: September 29th, 2006 under Internet.
Comments: 1
Comments
Pingback from KC’s Online Venture » A better way to redirect link with a .php file.
Time: October 2, 2006, 5:12 pm
[…] Please check http://www.aukcweb.com/2006/09/29/how-to-redirect-to-other-link/ for more details. […]
Write a comment