|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Groupee |
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! |
||
|
|
Craftsman |
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 should make it work.
April |
|||
|
Groupee Member![]() |
Thanks Steven, that could help me in the future
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) |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

