UBB.Dev
Posted By: blaaskaak [7,x] Force board url - 08/22/2007 9:03 PM
www.board.com, board.com, forum.board.com bla die bla stuff.

All those different url's? That's cookie login problems. This little hack will force your board to use the url from the Full URL to Main Directory setting in control panel.

open ubbthreads.php and find:

require_once("libs/ubbthreads.inc.php");

add below:

Code
// Force URL to FULL_URL config setting to avoid cookie problems.
$forcehost = parse_url($config['FULL_URL'],PHP_URL_HOST);
$subhost = $_SERVER['HTTP_HOST'];
if ($subhost!=$forcehost)
{
$newheader="Location: http://$forcehost".$_SERVER['REQUEST_URI'];
header($newheader);
exit;
} // end if

You can do this also with .htaccess stuff (see Gizmo's post on ubb central), but I prefer it this way. This makes every wrong url ok.
Posted By: Gizmo Re: [7,x] Force board url - 08/22/2007 10:07 PM
Or you could just try doing the .htaccess trick I posted over at central ("non-www to www urls", in the faq forum); one update globally forces users to use one URL at all times, and you don't have to re-apply each time you upgrade wink...

What I do on my forums however, since I own numerous domains and allow SSL, is set it so people can access the board from anywhere, granted cookie issues can arise, but I figure if someone is specifially accessing the site via our .net or .org (or ssl) there's a reason for it (such as an anal retentive sysadmin at their office).
Posted By: blaaskaak Re: [7,x] Force board url - 08/22/2007 10:14 PM
Originally Posted by Gizmo
Or you could just try doing the .htaccess trick I posted over at central ("non-www to www urls", in the faq forum); one update globally forces users to use one URL at all times, and you don't have to re-apply each time you upgrade wink...

If you are worried about re-applying hacks you are at the wrong forum here wink wink laugh

What I don't like about the .htaccess trick is that you have to make an entry for "each wrong case". This hack just checks if it's wrong and fixes it.

B.t.w., I linked to your .htaccess method post on ubb central in the first post.

Quote
What I do on my forums however, since I own numerous domains and allow SSL, is set it so people can access the board from anywhere, granted cookie issues can arise, but I figure if someone is specifially accessing the site via our .net or .org (or ssl) there's a reason for it (such as an anal retentive sysadmin at their office).

We have 2 main url's, and without this little trick, we had loads of people complaining about suddenly not being logged in.
Posted By: sirdude Re: [7,x] Force board url - 08/22/2007 10:29 PM
i like it blaaskaak ! :rawk:
Posted By: Gizmo Re: [7,x] Force board url - 08/22/2007 10:34 PM
A problem we've found is that some sys admin's go power hungry and ban everything that they deem inappropriate at work, in this case is them banning our NEWS site and saying it's a "hacker's haven" (the word of admin here)... So we allow multiple urls as well as ssl as ways to subvert this...

Which is funny, since 90% of the time, you can get around ban's of a site if they run ssl (go fig!)
Posted By: blaaskaak Re: [7,x] Force board url - 08/23/2007 7:39 AM
Originally Posted by Gizmo
A problem we've found is that some sys admin's go power hungry and ban everything that they deem inappropriate at work,

Ah, luckely that's something we never do (I'm a sys admin at a regional broadcast station (tv and radio), loads of journalists, who, if needed, have to be able to look up everything).

Quote
Which is funny, since 90% of the time, you can get around ban's of a site if they run ssl (go fig!)

But ubb will forward them at certain times to the default URL. So when actively using the board, they will end up at that default URL. This behavior of ubb was one of the reasons to implement it.
Posted By: sirdude Re: [7,x] Force board url - 08/23/2007 7:45 AM
i'm gonna implement your mod, blaaskaak..

and it's soooo simple even a caveman can do it... (inside joke about a commercial running for geico insurance)

ty,
SD
Posted By: Carte Blanche Re: [7,x] Force board url - 09/05/2007 2:32 PM
Ya know, when I was back home in the states in July and saw that ad campaign, I thought... what a stupid campaign. I come back to the states and I'm wanting to see quality commercials!!!
© UBB.Developers