How to remove the additional port number appended to the Dataface url upon form submission.
I have Xataface installed on an OS X server with PHP 5/MySQL5/Apache 1.3-ish. The issue I was having was that every time I would submit a form from within the Database framwework, the port # 16080 was being appended to the url, so I would end up with:
http://www.mysite:16080?index.php?-action=view&-table=mytable
The bad thing was, that in Safari, if I then submitted another form, that port would then be appended again, causing something like:
http://www.mysite:16080:16080?index.php?-action=view&-table=mytable
Which would of course be appended to all of the links on the page, causing them not to work. The problem had something to do with virtual hosts and the fact that (I think) each time you click a link inside Xataface, you redirect to the index page for further internal instruction.
Anyway, to the point. I managed to 'fix' this within Xataface by changing the following line in the 'config.inc.php' file:
if ( !($protocol == 'https' and $port == 443 ) and !($protocol == 'http' and $port == 80) ){
$_SERVER['HOST_URI'] .= ':'.$port;
}
to:
if ( !($protocol == 'https' and $port == 443 ) and !($protocol == 'http' and $port == 80) ){
$_SERVER['HOST_URI'];
}
This how to was taken from a forum post I had previously submitted. You can also just take out the whole 'if' statement all together.
Certain other non Xataface directories were exhibiting similar behavior when missing the trainling '/' at the end of a given url. In other words navigating to:
http://www.mysite.com/foo
would be redirected to:
http://www.mysite.com:16080/foo/
Whereas the following:
http://www.mysite.com/foo/
would simply go to:
http://www.mysite.com/foo/
Upon further investigation we discovered that if we turned off performance caching in Apache, this also fixed the problem in both Xataface and for the example above.