[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:
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.
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.