You are here: Re[2]: [PHP] Best way to do this: www.domain.com?page=var « PHP « IT news, forums, messages
Re[2]: [PHP] Best way to do this: www.domain.com?page=var

Posted by Steve Clay on 10/03/07 11:37

Tuesday, January 17, 2006, 10:54:21 AM, tg-php@gryffyndevelopment.com wrote:
> If you can't set a new 'default page' on your server, using a
> header('Location: ...') will simulate the same thing.

Not really. Sending a "Location:" header says, "this page is temporarily
moved" and the browser has to send a 2nd request for the new location.
Whether redirecting via PHP (header), javascript or meta-refresh, these all
needlessly force the browser to ask for the page twice, and potentially
cause bookmarking/spidering issues when used for the home page. Amazon
does this and it's annoying; some browsers just will not "remember" the
plain old "http://amazon.com/" that you typed in because only a redirect
lives there.

With a proper server config, the contents of start.php would be immediately
sent to the browser. This is good. But if you can't set this on the server,
this simple PHP script (index.php) does the same thing:
<?php require 'start.php'; ?>

Steve
--
http://mrclay.org/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация