We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Port fix to application.php when hosting locally with a port (localhost:8888) | Forum

Lloyd Merithew
Lloyd Merithew Oct 26 '10
The original private function urlHostRedirect() doesn't allow urls with a port like http://localhost:8888/oxwall

Replace the existing function code with new code below:

private function urlHostRedirect()
{
$urlArray = parse_url(OW_URL_HOME);
// returns an array including the port if it exists in the url OW_URL_HOME

if (isset($urlArray['port']))
{
$my_Host = ($urlArray['host'].':'.$urlArray['port']); // rejoin the host and port to build the url part like localhost:8888
} else {
$my_Host = ($urlArray['host']); // url without port
}

if ( isset($_SERVER['HTTP_HOST']) && ( $_SERVER['HTTP_HOST'] !== $my_Host ) ) // check to see the _SERVER['HTTP_HOST'] not equal to OW_URL_HOME
{
$this->redirect(OW_URL_HOME . OW::getRequest()->getRequestUri()); //redirect to proper url
}
}
Den Team
Den Oct 28 '10
Hello!
Thank you for instructions! But it seems we have fixed this issue in Beta5. On what version did you test this fix?
Lloyd Merithew
Lloyd Merithew Oct 28 '10
Addenster,

I'm using ow_1.0b5 on Mac Server 10.6.4 with MAMP. http://www.mamp.info/en/index.html

Regards
The Forum post is edited by Lloyd Merithew Oct 28 '10