Page duplicates #192

Closed
makzav opened this Issue Feb 20, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@makzav

makzav commented Feb 20, 2015

Page /content/sub/index.md can be requested as http://example.com/sub and http://example.com/sub/. In fact this is a two different pages with the same content and it is important to avoid page duplicates at least for search engines.

The same is with other combinations: /content/sub/page/index.md can be reached as http://example.com/sub/page and http://example.com/sub/page/.

Page duplicates needs to be redirected with 301 status code.

And what about optional trailing slash?

@makzav makzav changed the title from Page Duplicates to Page duplicates Feb 20, 2015

@makzav

This comment has been minimized.

Show comment
Hide comment
@makzav

makzav Feb 20, 2015

I see https://github.com/PhileCMS/Phile/pull/160/files has solution for preventing duplicates, but Phile 1.4.0 doesn't contain this.

makzav commented Feb 20, 2015

I see https://github.com/PhileCMS/Phile/pull/160/files has solution for preventing duplicates, but Phile 1.4.0 doesn't contain this.

@Schlaefer Schlaefer self-assigned this Feb 22, 2015

@Schlaefer Schlaefer added this to the v1.5.0 milestone Feb 22, 2015

Schlaefer added a commit to Schlaefer/Phile that referenced this issue Feb 28, 2015

@Schlaefer

This comment has been minimized.

Show comment
Hide comment
@Schlaefer

Schlaefer Mar 9, 2015

Member

Short recap:

  • Phile didn't care about a slash or no-slash
  • Then #170 removed the index from http://host/foo/index. There's now an ambiguity in http://host/foo/ (and http://host/foo). Is it content/foo.md or content/foo/index.md? Both are tested in that order at the moment. Phile still doesn't care about slashes.

So, should Phile be opinionated about slashes and if yes in which way?

I like what @kicken proposed in #198. Let's make it somewhat semantically sound: http:/host/foo means "page" and should point to content/foo.md. http:/host/foo/ means "folder" and should point to content/foo/index.md.

At the same time Phile should resolve potential 'slash'-errors:

  • http:/host/foo is requested and content/foo.md doesn't exist but content/foo/index.md → redirect to http:/host/foo/
  • http:/host/foo/ is requested and content/foo/index.md doesn't exist but content/foo.md → redirect to http:/host/foo

With those rules I would 👍

Member

Schlaefer commented Mar 9, 2015

Short recap:

  • Phile didn't care about a slash or no-slash
  • Then #170 removed the index from http://host/foo/index. There's now an ambiguity in http://host/foo/ (and http://host/foo). Is it content/foo.md or content/foo/index.md? Both are tested in that order at the moment. Phile still doesn't care about slashes.

So, should Phile be opinionated about slashes and if yes in which way?

I like what @kicken proposed in #198. Let's make it somewhat semantically sound: http:/host/foo means "page" and should point to content/foo.md. http:/host/foo/ means "folder" and should point to content/foo/index.md.

At the same time Phile should resolve potential 'slash'-errors:

  • http:/host/foo is requested and content/foo.md doesn't exist but content/foo/index.md → redirect to http:/host/foo/
  • http:/host/foo/ is requested and content/foo/index.md doesn't exist but content/foo.md → redirect to http:/host/foo

With those rules I would 👍

@STOWouters

This comment has been minimized.

Show comment
Hide comment
@STOWouters

STOWouters Mar 9, 2015

Contributor

At the same time Phile should resolve potential 'slash'-errors:

  • http:/host/foo is requested and content/foo.md doesn't exist but content/foo/index.md → redirect to http:/host/foo/
  • http:/host/foo/ is requested and content/foo/index.md doesn't exist but content/foo.md → redirect to http:/host/foo

With those rules I would

I had a similar problem in a web project, we solved it the way as you described it. It just feels somehow natural and intuitive to do so.

Contributor

STOWouters commented Mar 9, 2015

At the same time Phile should resolve potential 'slash'-errors:

  • http:/host/foo is requested and content/foo.md doesn't exist but content/foo/index.md → redirect to http:/host/foo/
  • http:/host/foo/ is requested and content/foo/index.md doesn't exist but content/foo.md → redirect to http:/host/foo

With those rules I would

I had a similar problem in a web project, we solved it the way as you described it. It just feels somehow natural and intuitive to do so.

@kicken

This comment has been minimized.

Show comment
Hide comment
@kicken

kicken Mar 9, 2015

Contributor

👍

Sounds good to me to normalize the slash both ways depending on what structure is in place for the actual files.

Contributor

kicken commented Mar 9, 2015

👍

Sounds good to me to normalize the slash both ways depending on what structure is in place for the actual files.

Schlaefer added a commit to Schlaefer/Phile that referenced this issue Mar 10, 2015

Schlaefer added a commit to Schlaefer/Phile that referenced this issue Mar 10, 2015

@Schlaefer

This comment has been minimized.

Show comment
Hide comment
@Schlaefer

Schlaefer Mar 10, 2015

Member

I made a new pull request #208 implementing those rules.

Member

Schlaefer commented Mar 10, 2015

I made a new pull request #208 implementing those rules.

@Schlaefer

This comment has been minimized.

Show comment
Hide comment
@Schlaefer

Schlaefer Mar 20, 2015

Member

fixed in #208

Member

Schlaefer commented Mar 20, 2015

fixed in #208

@Schlaefer Schlaefer closed this Mar 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment