Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow routes with a trailing slash to be recognized
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2039 state:committed]
- Loading branch information
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,7 +318,7 @@ def interpolation_chunk | |
end | ||
|
||
def regexp_chunk | ||
'(\.[^/?\.]+)?' | ||
'/|(\.[^/?\.]+)?' | ||
end | ||
|
||
def to_s | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that previously routes with a trailing slash were not recognized properly?
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means that it worked up to and including 2.2.2, was broken in 2.3.0 RC1, and is now fixed again.
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean 2 different urls for the same resource?… I mean, It’s a bot going to index those urls as duplicated content?
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wincent: that’s what I meant ;-) But thanks for clarifying. This explains some weirdness I’ve been experiencing with a Rails Edge project.
@Yizzreel: Depends entirely on the bot. Technically the URLs point to one and identical resource, so the URLs should be treated as the same, yes.
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ariejan
I’ve been reading a bit about this concern in Google’s webmaster tools. There’s an article in the help section about duplicated content
I’ll put an important note in this article
This mean that http://www.example.com/page/ and http://www.example.com/page are not the same url, therefore are not the same resource, therefore are duplicated content.
However, this problem would be important only if you include both url formats in your application, and link helpers will always generate ‘/’-less urls
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my previous comment, the paragrapth “Be consistent: …” is extracted from google help section (I tried to use textile ‘bq. ’ but it doesn’t work)
ce56c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you’re concerned about two URLs pointing to the same resource, consider using the new canonical URL meta tag:
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html