Saturday, August 29, 2009

Redirecting Web Pages Using PHP

You can redirect the root level of your site http://www.example.com/ to a lower level webpage like http://www.example.com/directory1/directory2/filename.html ) in many ways.

One way to make such a redirection, if you have a Linux hosting plan with GoDaddy, is to make a text file named "index.php" and have the file contain:

 <?php
//Redirect browser
header("Location: http://www.example.com/directory1/directory2/filename.html");
?>
 

Place it in the root of the "web/" directory in your hosting space and, barring a lot of complex configuration changes that may have been made previously, it should gentle redirect web visitors from http://www.example.com/ to http://www.example.com/directory1/directory2/filename.html .

4 comments:

Thiru Cumaran said...

David, I'd like to share an album which I have on my Facebook profile on my blog (operated using blogger)...I'd like the viewers to be able to view the album on my blog itself rather than having to be redirected to facebook...do you know a solution to this?

David August said...

Your easiest option would be to use a photo badge, Facebook's widget designed to do this. Best of luck!

Thiru Cumaran said...

David, just tried that out but realised that the pictures were a tad small....

I hope I don't sound whiny, but is there something that would allow me to display them in their full size?

David August said...

Best option to integrate images into a blogger blog is to put the images in the posts with blogger. You can upload images from the new post page or mobile. If you host it on your own hosting space, it'll pit the images there, if your blog is hosted on blogspot, it'll put them in a picassa album. Facebook and Google (owners of blogger) are seperate companies, and aside from the photo badge I mentioned in my earlier comment, they don't offer free ways to integrate Facebook photo albums into a blogger blog. A custom solution may be an option, but would not be free.