Eve For Enterprise    Eve Support Community    Forums  Hop To Forum Categories  Resources  Hop To Forums  Webmastering 101    Redirection with PHP
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Groupee
Posted
I've seen a few people ask about how they can redirect people from parts of their website (e.g. their home page) to their UBB.x.

Below is a code sample that will forward visitors to your UBB.x. Note: It can also be used to redirect people to other parts of your site, just change the URL variable to the destination.

<?php
    $url = "http://www.yoursite.com/6/ubb.x?a=cfrm&s=12345678";
    header("Location: $url");
    exit();
?>


Just copy and paste the code into a new file. Name it index.php and put it in the directory you want to forward visitors from (e.g. /var/www/html for the root of your website). Remember to remove any other index pages. (index.htm, index.html, et al.)

Enjoy! cool
 
Posts: 3880 | Location: Seattle, WA | Registered: January 01, 2000Reply With QuoteEdit or Delete MessageReport This Post

Craftsman
Posted Hide Post
Hey thanks for that code Steven. Also, it's good to note that header(); will break if there is any html code or white space above the php call. I still do this all the time, but taking out the white space before the
April
 
Posts: 977 | Location: Seattle | Registered: January 28, 2002Reply With QuoteEdit or Delete MessageReport This Post
Groupee Member
Picture of David Rivera
Posted Hide Post
Thanks Steven, that could help me in the future wink



Here is code somehow related to this that I'll like to share.

It redirects people to a specified page if the URL they enter doesn't exist on the site.

Go to the html subweb then click the edit image on the .htaccess file,

CODE:

 ErrorDocument 404 http://www.yourdomain.com 



Copy and past and past this code after the very last line in that file. You can change the URL to the page that you want to redirect in your website. For example: if any user types www.yourdomain.com/content/games/space/play.html and that file doesn't not exist on your website then this code is going to redirect the user to whaterever page you provide. (This doesn't work for UBB.x)
 
Posts: 502 | Location: Atlanta, GA | Registered: July 29, 2002Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Eve For Enterprise    Eve Support Community    Forums  Hop To Forum Categories  Resources  Hop To Forums  Webmastering 101    Redirection with PHP