ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


using relatives URL


  • 2008-07-14 19:28:51

    using relatives URL

    Hi all,
    The problem is this.

    Our installation is in an experimental webserver, behind a proxy and the hosts is not the same than the main web server.

    To experiment from the outside mod_rewrite is used in order to traduce from https://www.domain/institute/e-cursos to http://experimental/ATutor.

    The application generates all the URLS in the form http://experimental/ATutor/somthing....

    Is there a way to make URL relatives to ATutor instalation? Lets say ./something ?

    Thank you,
    Mario

    PS: please copy to mmadera@fing.edu.uy
    Operating system ATutor is installed on - Windows Xp
    ATutor version - 1.5.4
    ATutor theme name - Default
    PHP version - 5.2.1
    MySQL version - 5.0.37
    Webserver & version - apache 2.2.4

  • 2008-07-15 11:14:11

    Re: using relatives URL

    ATutor generates the URLs based on PHP server path, which is defined in include/lib/constants.inc.php, define('AT_BASE_HREF', $_base_href);

    You may try alter the following:
    $url_parts = explode('/', $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);

    to say

    $url_parts = explode('/', $_SERVER['HTTP_HOST'] . 'experimental/ATutor');

  • 2008-07-15 15:28:41

    Re: using relatives URL

    HI Harris, thanks for your reply, but I think it would not work.

    I believe this, because PHP_SELF includes the script name.

    And I must say sorry because I hadn't explain myself clear. The rewriting rules changes https://www.fing.edu.uy/iimpi/e-cursos to https://myhost.fing.edu.uy/ATutor.

    Perhaps if I change
    $url_parts = explode('/', $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);

    to

    $url_parts = explode('/', 'https://myhost.fing.edu.uy/ATutor');

    it works, but the script name is lost....

    Thanks again,
    Mario

  • 2008-07-15 15:36:50

    Re: using relatives URL

    Ah, in this case, how about setting a constant for your original host (www.fing.edu.uy/iimpi/e-cursos), and replace it by 'myhost.fing.edu.uy/ATutor' before the url_parts is generated.

  • 2008-07-15 16:01:11

    Re: using relatives URL

    Sorry, I meant before the $_base_href is generated, not url_parts.

    [reply][b]In reply to:[/b]
    Ah, in this case, how about setting a constant for your original host (www.fing.edu.uy/iimpi/e-cursos), and replace it by 'myhost.fing.edu.uy/ATutor' before the url_parts is generated.
    [op]forums/view.php?fid=7;pid=14497;page=1#14508[/op][/reply]

  • 2008-07-15 17:58:05

    Re: using relatives URL

    Harris, thanks again. I had try the solution you mention befor posting whithout success, mod_rewrite enter in loop aparently.

    So, after some advice from Greg in other post and 'hacking' around I get it!

    I will sumerize the modifications I made, and post them here.

    Mario.