aboutsummaryrefslogtreecommitdiff
path: root/config_sample.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-07-20 08:51:38 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-07-20 08:51:38 +0200
commit1a096c96c20933884fb1a22704d75df0ed8a306f (patch)
tree74900d9a7b3b9e0bacaee835580d9424fc5eed13 /config_sample.rb
parent231da940da1842740b842a06d126d3562b5b7822 (diff)
Care about possible other ports and protocol
Diffstat (limited to 'config_sample.rb')
-rw-r--r--config_sample.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/config_sample.rb b/config_sample.rb
index 5497f47..aac1ff8 100644
--- a/config_sample.rb
+++ b/config_sample.rb
@@ -23,8 +23,19 @@
# Warning: git needs git >=1.6.5
require "git"
-# Change this if the url is not determined correctly
-SITEURL = "http://#{$cgi.server_name}#{$cgi.script_name.gsub(/[^\/]*$/,"")}"
+# Change the SITEURL if the url is not determined correctly
+case $cgi.server_port
+when 80
+ protocol = "http"
+ port = ""
+when 443
+ protocol = "https"
+ port = ""
+else
+ protocol = "http"
+ port = ":#{$cgi.server_port}"
+end
+SITEURL = "#{protocol}://#{$cgi.server_name}#{port}#{$cgi.script_name.gsub(/[^\/]*$/,"")}"
# If you want to encourage the user to send bug reports, state the errorlog,
# which you have configured in your apache conf with the ErrorLog directive.