1

I got a page that lists videos in an index view. The view is filterable by several indicators, like 'newest videos first' and 'highest ranked videos first'. The user can choose from one of these options.

The filter information is stored in the users session. To control the session parameters, there are different routes, that get called when the user clicks a filter button, like "domain.com/videos/newest" or "domain.com/videos/ranking".

Dependent on which route gets called the server alters the session parameter.

In fact the SAME page is rendered but videos are listed in different orders. This leads to duplicate Page Titles, Meta descriptions and things like that. This should be avoided. I want to have one route "domain.com/videos" without additional filter control parameters.

Obviously there are different approaches:

  1. Sticking with the current solution, providing different routes, that are leading to the same rendered page, and deal with duplicate content.

  2. Using GET Parameters like domain.com/videos?filter=newest, which is not good from a SEO perspective as well.

  3. Using Cookies to store the information in each Requestheader, which leads me to the need of a Cookie Agreement message and makes the page experience ugly.

  4. ...

Are there recommendations to deal with the described problem?

UPDATE

@Tim Lewis suggested (thank you very much for the replie):

If you don't want URL parameters, you can do a POST request that stores these filter/search/sort values in Laravel's session, then reference them in the GET request; $sort = session()->get("sort"); or similar. They wouldn't show up in the URL, and the only page SEO would be aware of would be domain.com/videos

Are there more people that go confirm with that ?

6
  • 1
    If you don't want URL parameters, you can do a POST request that stores these filter/search/sort values in Laravel's session, then reference them in the GET request; $sort = session()->get("sort"); or similar. They wouldn't show up in the URL, and the only page SEO would be aware of would be domain.com/videos Commented Jun 11, 2019 at 15:49
  • Just a heads up; this question may be closed for "Primarily opinion based"; people tend not to be able to agree what the best approach for this is, so I don't know if you'll get a clear answer. If you do decide to go with a specific approach, feel free to post that as an answer and close this question though. Commented Jun 11, 2019 at 16:07
  • I removed the opinionated "best practice" parts, since this is specific enough to answer Commented Jun 11, 2019 at 17:08
  • @Tim Lewis: this would imply to open a new POST route to submit a form to, and a hard redirect to the previous GET route after reacting to the form content by adjusting the session variables. This seems to be messed up in my opinion, since search engines will track the newly created POST route and punish the redirect. Commented Jun 11, 2019 at 18:38
  • @Machavity: I am not 100% confirm with the title change. The question is aiming pretty much for search engine optimization. Avoiding URL Parameters in general brings up much more good solutions, as the one mentioned by Tim Lewis, but won't be the best approach for SEO optimization. I think "Handling filtered pages for SEO optimization" or something similar would describe the problem better. Commented Jun 11, 2019 at 18:42

1 Answer 1

2

Instead of worrying about the GET parameters, set a canonical link for your videos page by outputting this on all of the various filtered routes:

<link rel="canonical" href="http://example.com/videos">

This will prevent indexing of the alternative views of the same content.

Sign up to request clarification or add additional context in comments.

1 Comment

According to support.google.com/webmasters/answer/139066?hl=en and moz.com/learn/seo/canonicalization this seems to be the 'correct' answer, even if there might be different solutions to avoid the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.