Difference between revisions of "20 baseurls.pl"

From EPrints Documentation
Jump to: navigation, search
(Added actually file name in bold.)
 
Line 2: Line 2:
 
{{cfgd}}
 
{{cfgd}}
  
You should probably never edit this file unless you really really know what your doing.
+
'''20_baseurls.pl''' uses ''10_core.pl'' to build the URLs it will need use in template, code and configuration elsewhere. You should probably never edit this file unless you really really know what your doing.
  
 
==Example==
 
==Example==

Latest revision as of 12:01, 27 January 2022

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Back to cfg.d

20_baseurls.pl uses 10_core.pl to build the URLs it will need use in template, code and configuration elsewhere. You should probably never edit this file unless you really really know what your doing.

Example

{
        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";
}