i need the http://www.website.com/index.php to stay there because i need the meta tags to populate thru the name servers and i'm currently working on it. is there a way i can have visitors come in and get re-routed automatically without clicking on any link? perferablely without any wait time. thanks
URL forwarding
Moderator: General Moderators
URL forwarding
i have a website www.website.com that i'm building but it's not done. so other pages are done but still working on the front end. so i want to be able to route all visitors to www.website.com/testing/index.php i tried using the header() but i'm guessing because i'm using meta tags it's sending out packets before the header and causing it to error out.
i need the http://www.website.com/index.php to stay there because i need the meta tags to populate thru the name servers and i'm currently working on it. is there a way i can have visitors come in and get re-routed automatically without clicking on any link? perferablely without any wait time. thanks
i need the http://www.website.com/index.php to stay there because i need the meta tags to populate thru the name servers and i'm currently working on it. is there a way i can have visitors come in and get re-routed automatically without clicking on any link? perferablely without any wait time. thanks
Put your header calls before your meta tags
Code: Select all
<?php
header('location ...');
?>
<html>
<head>
<meta ...Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
fyi, always include an exit() call after any header to prevent other code from potentially being executed.scottayy wrote:Put your header calls before your meta tags
Code: Select all
<?php header('location ...'); ?> <html> <head> <meta ...
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
die() is exit() - its an alias 
You can also use output buffering if placing headers above meta tags is too much trouble - http://ie.php.net/manual/en/ref.outcontrol.php
You can also use output buffering if placing headers above meta tags is too much trouble - http://ie.php.net/manual/en/ref.outcontrol.php
thx if i use the or die command i thought it wont read any code after that. it will still read the meta tags and other codes etc? i will go ahead and test that out. if i could ask one more question
for future purposes, how would i code this, when a user enters a link or download, etc., and i want to re-direct them but i would want a wait time. like this site for instance. after posting, it will perform this: wait 5 seconds and it will re-direct you if not click here. hows that done?
for future purposes, how would i code this, when a user enters a link or download, etc., and i want to re-direct them but i would want a wait time. like this site for instance. after posting, it will perform this: wait 5 seconds and it will re-direct you if not click here. hows that done?