URL translation

Posts from previous Beta sessions

URL translation

Postby celephaiis » Sat Feb 16, 2008 7:13 pm

Hi, since the [1634] release (and maybe sooner), I am experiencing some problems with url translation.

Roster is installed at my ISP on the follwing directry ~guildeob/www/roster2 wich is accessed through the URLs
Code: Select all
http://www.guilde-obliterate.org/roster2/ or
http://roster.guilde-obliterate.org


When I access the main roster page, I can't see any graphics and all the URL on this page begin are like this ones
Code: Select all
http://www.guilde-obliterate.org/home.10/guildeob/www/roster2/index.php?p=update or
http://roster.guilde-obliterate.org/home.10/guildeob/www/roster2/#


it seems that the base URL is replaced with the base directory of my account.

Of course I do not have access to the configuration menu and I have not found the parameter I should change in the database to correct this bug.

Is there something I am missing or is this bug caused by any PHP/Apache server misconfiguration ?

Thxs in advance.
Last edited by celephaiis on Sat Feb 16, 2008 7:14 pm, edited 1 time in total.
celephaiis
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Wed Oct 18, 2006 1:53 pm

URL translation

Postby zeryl » Sat Feb 16, 2008 10:51 pm

Try roster_config.interface_url
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

URL translation

Postby PleegWat » Sun Feb 17, 2008 3:10 am

Find this section in lib/cmslink.lib.php:

Code: Select all
/**
 * Get the full URL to roster's root directory
 * You can modify the defines 'ROSTER_URL' and 'ROSTER_PATH' to suit your needs
 * and bypass the url checks if needed
 */
$url explode('/','http://' $_SERVER['SERVER_NAME']  . (( $_SERVER['SERVER_PORT'] != 80 ) ? ':' $_SERVER['SERVER_PORT'] : '' ) . $_SERVER['PHP_SELF']);
array_pop($url);
$url implode('/',$url) . '/';

define('ROSTER_URL',$url);
unset(
$url);


/**
 * Get the url path to roster's directory
 */
$urlpath explode('/',$_SERVER['PHP_SELF']);
array_pop($urlpath);
$urlpath implode('/',$urlpath) . '/';

define('ROSTER_PATH',$urlpath);
unset(
$urlpath);
 


Replace with:
Code: Select all
/**
 * Get the full URL to roster's root directory
 * You can modify the defines 'ROSTER_URL' and 'ROSTER_PATH' to suit your needs
 * and bypass the url checks if needed
 */
define('ROSTER_URL','http://roster.guilde-obliterate.org');

/**
 * Get the url path to roster's directory
 */
define('ROSTER_PATH','/');
 
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: URL translation

Postby celephaiis » Sun Feb 17, 2008 6:12 am

Thanks... hardcoded solution :)

By the way, do you know why is this script buggy for my configuration ?
celephaiis
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Wed Oct 18, 2006 1:53 pm

URL translation

Postby Anaxent » Sun Feb 17, 2008 7:45 am

This is most likely caused due to the apache configuration that your hosting company uses. It looks by the way you shown us the directory structure that your host using using the apache config for userdir which basically maps out the full path to a ~username like so ~guildeob/www/roster2 which in reality the full path is probably /var/www/vhost/home.10/guildeob/www/roster2/ and then when $_SERVER['PHP_SELF'] is used it is trying to pull the full path out of the ~guildeob which it really does not know how to handle well.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

URL translation

Postby PleegWat » Sun Feb 17, 2008 4:47 pm

The autodetect mechanisms usually work correctly. If they don't, hardcoding is easier than finding a real solution. If you'd like me to look at a real solution, create a file called 'test.php' in the roster2/pages directory, with the following contents:

Code: Select all

aprint
($_SERVER);
 


Then either post here that you've done so so I can look at the output, or post it here. You need the contents of the grey box in http://roster.guilde-obliterate.org/index.php?p=test

EDIT: Fixed php code display
Last edited by PleegWat on Sun Feb 17, 2008 4:48 pm, edited 1 time in total.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

URL translation

Postby celephaiis » Sun Feb 17, 2008 5:47 pm

I was just curious about the reason of this bug and the hardcoded solution is fine for me.

Anyway, if you want to investigate further, the test page is up.
celephaiis
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Wed Oct 18, 2006 1:53 pm

URL translation

Postby PleegWat » Sun Feb 17, 2008 8:12 pm

Hm, this is weird. PHP_SELF is correct. It should resolve to the correct url. SCRIPT_FILENAME is bad, but we don't use that one, afaik.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

URL translation

Postby celephaiis » Sun Feb 17, 2008 11:42 pm

Maybe some cache issue or host configuration change without being warned.

Everything is working with the harcoded solution so it's ok for me.

Thanks ;)
celephaiis
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Wed Oct 18, 2006 1:53 pm

URL translation

Postby PleegWat » Mon Feb 18, 2008 3:12 am

Had some talking over it with anax, and took some looks at some other URI's that should give the same page. There's something weird going on with the url rewriting at your system.

http://roster.guilde-obliterate.org/index.php?p=test gives correct output
http://roster.guilde-obliterate.org/?p=test does not
http://roster.guilde-obliterate.org/test.html doesn't either

The last two give weird results in $_SERVER['PHP_SELF']. This is most likely due to a setting with your host's php.ini.

Unfortunately, this investigation did not result in anything we can patch future roster versions with...
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

URL translation

Postby celephaiis » Fri Feb 22, 2008 7:13 am

Ok... If a can help in any way, let me know.
celephaiis
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Wed Oct 18, 2006 1:53 pm


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron