fix URL handling on RT redirects
[freeside.git] / rt / etc / RT_SiteConfig.pm
index ef110db..a5195f2 100644 (file)
@@ -25,9 +25,6 @@ $RT::Organization = '%%%RT_DOMAIN%%%';
 
 $RT::Timezone = '%%%RT_TIMEZONE%%%';
 
-$RT::WebBaseURL = '';
-$RT::WebPath = '/freeside/rt';
-
 $RT::WebExternalAuth = 1;
 $RT::WebFallbackToInternal = 1; #no
 $RT::WebExternalAuto = 1;
@@ -35,6 +32,10 @@ $RT::WebExternalAuto = 1;
 $RT::URI::freeside::IntegrationType = 'Internal';
 $RT::URI::freeside::URL = '%%%FREESIDE_URL%%%';
 
+$RT::URI::freeside::URL =~ m(^(https?://[^/]+)(/.*)$)i;
+$RT::WebBaseURL = $1;
+$RT::WebPath = "$2/rt";
+
 Set($DatabaseHost   , '');
 
 # These settings are user-editable.