jumph4x/canonical-rails

Trailing slash issue.

Closed this issue · 2 comments

You cannot configure if you want to add a trailing slash or have it removed.

Currently I have my rails setup to not use trailing slash

application.rb

config.action_controller.default_url_options = { trailing_slash: false }

However the canonical URL has a trailing slash and this URL is redirect to no trailing slash.

@keferboeck You might want to change this line to set the collections to an empty array: https://github.com/jumph4x/canonical-rails/blob/master/lib/generators/canonical_rails/install/templates/canonical_rails.rb#L20

I used collections vs single resource URLs as a broad way of determining which URLs should canonicalize with a trailing slash to follow Unix and very early web conventions, but Rails and other frameworks do not generally follow this standard.

@keferboeck marked as resolved.