Previous Thread
Next Thread
Print Thread
Rate Thread
[7,x] Force board url #315358
08/22/2007 2:03 PM
08/22/2007 2:03 PM
Joined: Feb 2007
Posts: 330
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 330
The Netherlands
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.


[Linked Image]
Sponsored Links
Re: [7,x] Force board url [Re: blaaskaak] #315359
08/22/2007 3:07 PM
08/22/2007 3:07 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
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, UBB.SitemapsJames Corthell
Re: [7,x] Force board url [Re: Gizmo] #315360
08/22/2007 3:14 PM
08/22/2007 3:14 PM
Joined: Feb 2007
Posts: 330
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 330
The Netherlands
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.


[Linked Image]
Re: [7,x] Force board url [Re: blaaskaak] #315361
08/22/2007 3:29 PM
08/22/2007 3:29 PM
Joined: Nov 2003
Posts: 491
SoCal
S
sirdude Offline
Enthusiast
sirdude  Offline
Enthusiast
S

Joined: Nov 2003
Posts: 491
SoCal
i like it blaaskaak ! :rawk:

Re: [7,x] Force board url [Re: sirdude] #315362
08/22/2007 3:34 PM
08/22/2007 3:34 PM
Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
Gizmo Online tapedshut

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Online Tapedshut

UBB.Dev / UBB.Wiki Owner
Time Lord

Joined: Jan 2000
Posts: 5,941
Portland, OR, USA
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, UBB.SitemapsJames Corthell
Sponsored Links
Re: [7,x] Force board url [Re: Gizmo] #315370
08/23/2007 12:39 AM
08/23/2007 12:39 AM
Joined: Feb 2007
Posts: 330
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 330
The Netherlands
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.


[Linked Image]
Re: [7,x] Force board url [Re: blaaskaak] #315372
08/23/2007 12:45 AM
08/23/2007 12:45 AM
Joined: Nov 2003
Posts: 491
SoCal
S
sirdude Offline
Enthusiast
sirdude  Offline
Enthusiast
S

Joined: Nov 2003
Posts: 491
SoCal
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

Re: [7,x] Force board url [Re: sirdude] #315538
09/05/2007 7:32 AM
09/05/2007 7:32 AM
Joined: Oct 2006
Posts: 21
Auckland, NZ
C
Carte Blanche Offline
Newbie
Carte Blanche  Offline
Newbie
C

Joined: Oct 2006
Posts: 21
Auckland, NZ
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!!!


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
· Blue Host
· Interserver.net
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,453
Posts293,495
Members13,800
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 25,587
JoshPet 11,330
Rick 8,373
LK 7,396
Lord Dexter 6,503
Gizmo 5,941
Greg Hard 5,533
Top Posters(30 Days)
isaac 8
Gizmo 3
Today's Statistics
Currently Online 846
Topics Created 0
Posts Made 0
Users Online 2
Birthdays 21
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.6.3
(Snapshot build 20180915.dev)
Page Time: 0.077s Queries: 15 (0.013s) Memory: 3.2966 MB (Peak: 3.5694 MB) Zlib enabled. Server Time: 2018-09-21 14:01:55 UTC