Hey guys, I am a novice in PHP and I'm trying to redirect a .html page of my site (only a single page) using PHP redirect. Here's the code I use: <?php header("Location: http://www.domainname.com"); exit; ?> Am I supposed to simply place this PHP code into the .html file and remove all its content and then upload the file? Because this is what I've done and it's still not working. I get a blank white page. Can anyone please give me a hand? Thanks a lot
put this code in your that html file and remove all codes . Make a backup of that page before doing this. incase it wont work upload th eold page again. ---------- <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.YOURWEBITE.com" ); ?>
Thanks but it still doesn't work .. Have no idea why because all the tutorials I've read so far explain the exact same method.. Anybody knows another way of redirecting a .html page using PHP? Thanks
do you know bout .htaccess ?? if you have access to this file than the things can be pretty easy here is the procedure To create a .htaccess file, open notepad, in the name field type .htaccess and save the file type as all files 2. If you already have a .htaccess file on your server, download it to your desktop for editing. 3. Place this code in your .htaccess file: redirect 301 /old/old.htm http://www.you.com/new.htm 4. If the .htaccess file already has lines of code in it, skip a line, then add the above code. 5. Save the .htaccess file 6. Upload this file to the root folder of your server. 7. Test it by typing in the old address to the page you've changed. You should be immediately taken to the new location.
I can try this method as well, the thing I did not mention is that I want to redirect the page to another domain. (a vendor's domain) -- redirecting with my affiliate link is it the same thing?
Tx .. I've managed to do it using a simple html redirect. <html> <head> <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.domain.com"> </head> First I've removed all the code from the page (if all the initial code remains there and this html redirect is being used then the initial page appears before the actual redirected page so it's pretty useless)
Just a question - when you tried to add the PHP-code the first time around - did you change the .html extension of the file to .php? Unless you did, it won't work.