Previous Thread
Next Thread
Print Thread
Rate Thread
#315358 08/22/2007 2:03 PM
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
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.

Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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).


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
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.

Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
i like it blaaskaak ! :rawk:

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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!)


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
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.

Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
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

Joined: Oct 2006
Posts: 21
Newbie
Newbie
Offline
Joined: Oct 2006
Posts: 21
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!!!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)