projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
23f2ac9
)
Set canonical port based on protocol
author
Tom Hughes
<tom@compton.nu>
Wed, 22 Mar 2017 19:28:57 +0000
(19:28 +0000)
committer
Tom Hughes
<tom@compton.nu>
Wed, 22 Mar 2017 19:28:57 +0000
(19:28 +0000)
config/initializers/canonical_rails.rb
patch
|
blob
|
history
diff --git
a/config/initializers/canonical_rails.rb
b/config/initializers/canonical_rails.rb
index c443c8bf816461d99b77043a5bd4416d62c13323..0d1461ed7b153758d893a1216a602a3f9ef792e8 100644
(file)
--- a/
config/initializers/canonical_rails.rb
+++ b/
config/initializers/canonical_rails.rb
@@
-6,6
+6,7
@@
CanonicalRails.setup do |config|
# This is the main host, not just the TLD, omit slashes and protocol. If you have more than one, pick the one you want to rank in search results.
config.host = SERVER_URL
# This is the main host, not just the TLD, omit slashes and protocol. If you have more than one, pick the one you want to rank in search results.
config.host = SERVER_URL
+ config.port = SERVER_PROTOCOL == "https" ? 443 : 80
# http://en.wikipedia.org/wiki/URL_normalization
# Trailing slash represents semantics of a directory, ie a collection view - implying an :index get route;
# http://en.wikipedia.org/wiki/URL_normalization
# Trailing slash represents semantics of a directory, ie a collection view - implying an :index get route;