Skip to content

Commit

Permalink
redirect www to puneruby.org
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamrege committed Jul 13, 2012
1 parent 4a4917a commit e4f03e2
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 63 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gem 'tweet-button'

group :production do
gem 'pg'
gem 'rack-rewrite'
end

# Gems used only for assets and not required
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ GEM
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-rewrite (1.2.1)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
Expand Down Expand Up @@ -223,6 +224,7 @@ DEPENDENCIES
omniauth-twitter
passenger
pg
rack-rewrite
rails!
rspec-rails (>= 2.8.0rc1)
sass-rails!
Expand Down
132 changes: 69 additions & 63 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,72 +19,78 @@

# Generate digests for assets URLs
config.assets.digest = true

config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
r301 %r{.*}, 'http://puneruby.org$&', :if => Proc.new {|rack_env|
rack_env['SERVER_NAME'] != 'puneruby.org'
}
end

=begin
config.assets.precompile += [
'codemirror.css',
'codemirror.js',
'feather_cms.js',
'css.js',
'htmlmixed.js',
'javascript.js',
'xml.js',
'dialog.css',
'dialog.js',
'foldcode.js',
'formatting.js',
'javascript-hint.js',
'match-highlighter.js',
'overlay.js',
'runmode.js',
'search.js',
'searchcursor.js',
'simple-hint.css',
'simple-hint.js' ]
=end

# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH

# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# See everything in the log (default is :info)
# config.log_level = :debug

# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]

# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

# Use a different cache store in production
# config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )

# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false

# Enable threaded mode
# config.threadsafe!

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.assets.precompile += [
'codemirror.css',
'codemirror.js',
'feather_cms.js',
'css.js',
'htmlmixed.js',
'javascript.js',
'xml.js',
'dialog.css',
'dialog.js',
'foldcode.js',
'formatting.js',
'javascript-hint.js',
'match-highlighter.js',
'overlay.js',
'runmode.js',
'search.js',
'searchcursor.js',
'simple-hint.css',
'simple-hint.js' ]
=end

# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH

# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# See everything in the log (default is :info)
# config.log_level = :debug

# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]

# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

# Use a different cache store in production
# config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )

# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false

# Enable threaded mode
# config.threadsafe!

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true

# Send deprecation notices to registered listeners
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
end
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
end

0 comments on commit e4f03e2

Please sign in to comment.