20 baseurls.pl

From EPrints Documentation
Revision as of 12:33, 20 July 2010 by Pm705 (talk | contribs) (Created page with '<pre> { my $uri = URI->new( "http://" ); if( EPrints::Utils::is_set( $c->{host} ) ) { $uri->scheme( "http" ); $uri->host( …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
{
        my $uri = URI->new( "http://" );
        if( EPrints::Utils::is_set( $c->{host} ) )
        {
                $uri->scheme( "http" );
                $uri->host( $c->{host} );
                $uri->port( $c->{port} );
                $uri = $uri->canonical;
                $uri->path( $c->{http_root} );
        }
        else
        {
                $uri->scheme( "https" );
                $uri->host( $c->{securehost} );
                $uri->port( $c->{secureport} );
                $uri = $uri->canonical;
                $uri->path( $c->{https_root} );
        }

# EPrints base URL without trailing slash
        $c->{base_url} = "$uri";
# CGI base URL without trailing slash
        $c->{perl_url} = "$uri/cgi";
}