Answers.Body: <p>The parameterized paths (as opposed to the queries) implies a certain hierarchy. According to <a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/en//webmasters/docs/search-engine-optimization-starter-guide.pdf" rel="nofollow noreferrer">Google's SEO document</a>, you have to anticipate that users will cut a part of the URL off. What happens if they cut out "usa", but "country"?</p>
  
  <p>What you're doing right now is filtering/searching, not creating a hierarchy. So, you're complicating your own routing (making it more likely to fail and thus hurting your SEO even further), and not conveying the information particularly accurately.</p>
  
  <p>If you want the parameterized URLs as opposed to query strings, you'll want to <a href="https://www.woorank.com/en/blog/guide-to-clean-urls-for-seo-and-usability" rel="nofollow noreferrer">reorganize your URL structure to be hierarchical</a> -- i.e. - <code>products/shirts/tshirts</code> -- and drop off the "parameter names" that you're trying to shoe-horn in. </p>
  
  <p>Also, consider whether that particular page actually <em>needs</em> to be indexed by search engines, and if it needs to be indexed <em>with the query string</em>. Can you simply allow it to be indexed without any filtering? Does it need to be indexed at all? If you don't need to index it, then you can keep the query string for human usability, and tell spiders not to index it at all. If you don't need to index it as filtered and going to the page, without a query string, results in the non-filtered content, then most spiders will do that by default.</p>
  
  <p>For example, look at <code>google.com</code>, before and after a search. Obviously, search result pages don't need to be indexed (nor would you want to, because that would result in a ton of botched indexed), but the main page, itself, probably should be. As a result, they use a query string that includes <code>q=searchstring</code> on their search results page.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-07T17:04:37.463Z
Answers.Text: Thanks for your elaborate answer! It doesn't answer my question, which I would still like to see answered for future reference, but it did convince me to change my strategy :)
Answers.UserDisplayName: Paul
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-08T14:51:10.593Z
Answers.Text: If there's one thing I've learned in my years as a programmer, it's that if you have to jump through a bunch of hoops to do what you want to do (especially if you're working with a framework or CMS), odds are good you're barking up the wrong tree. :)
Answers.UserDisplayName: Shauna
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-07T15:39:39.090Z
Answers.LastActivityDate: 2016-11-07T15:39:39.090Z
Answers.UserDisplayName: Shauna
Body: <p>Given a category based set of entries/products, and a filter system based on tags, how would I accept (one of) the following urls and let one template process them all (not interested in the processing, just want to know how to set up the route):</p>
  
  <ul>
  <li>example.com/category/foo -> category page, containing products</li>
  <li>example.com/category/foo/type/bar -> category page, filtered by relation to tag (group = 'type') with value 'bar'</li>
  <li>example.com/category/foo/type/bar/country/usa -> category page, filtered by multiple relations (filters)</li>
  <li>example.com/category/foo/country/usa/type/bar -> category page, filtered by same relations as above</li>
  </ul>
  
  <p>This would be more SEO-friendly than example.com/category/foo?type=bar&amp;country=usa</p>
  
  <p>Anyone done this before?</p>
  
Tags: <categories><url><routes>
Title: How can I set up a filter URL like example.com/category/foo/type/bar/country/usa
ThreadText: # How can I set up a filter URL like example.com/category/foo/type/bar/country/usa
  
  (Asked by: username_0 on 2016-11-07)
  
  Given a category based set of entries/products, and a filter system based on tags, how would I accept (one of) the following urls and let one template process them all (not interested in the processing, just want to know how to set up the route):
  
  * example.com/category/foo -> category page, containing products
  * example.com/category/foo/type/bar -> category page, filtered by relation to tag (group = 'type') with value 'bar'
  * example.com/category/foo/type/bar/country/usa -> category page, filtered by multiple relations (filters)
  * example.com/category/foo/country/usa/type/bar -> category page, filtered by same relations as above
  
  This would be more SEO-friendly than example.com/category/foo?type=bar&country=usa
  
  Anyone done this before?
  
  **Tags:** categories, url, routes
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-11-07. Score: 2
  
  The parameterized paths (as opposed to the queries) implies a certain hierarchy. According to [Google's SEO document](http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/en//webmasters/docs/search-engine-optimization-starter-guide.pdf), you have to anticipate that users will cut a part of the URL off. What happens if they cut out "usa", but "country"?
  
  What you're doing right now is filtering/searching, not creating a hierarchy. So, you're complicating your own routing (making it more likely to fail and thus hurting your SEO even further), and not conveying the information particularly accurately.
  
  If you want the parameterized URLs as opposed to query strings, you'll want to [reorganize your URL structure to be hierarchical](https://www.woorank.com/en/blog/guide-to-clean-urls-for-seo-and-usability) -- i.e. - `products/shirts/tshirts` -- and drop off the "parameter names" that you're trying to shoe-horn in.
  
  Also, consider whether that particular page actually *needs* to be indexed by search engines, and if it needs to be indexed *with the query string*. Can you simply allow it to be indexed without any filtering? Does it need to be indexed at all? If you don't need to index it, then you can keep the query string for human usability, and tell spiders not to index it at all. If you don't need to index it as filtered and going to the page, without a query string, results in the non-filtered content, then most spiders will do that by default.
  
  For example, look at `google.com`, before and after a search. Obviously, search result pages don't need to be indexed (nor would you want to, because that would result in a ton of botched indexed), but the main page, itself, probably should be. As a result, they use a query string that includes `q=searchstring` on their search results page.
  
  > **Comments:**
  > **username_0**: Thanks for your elaborate answer! It doesn't answer my question, which I would still like to see answered for future reference, but it did convince me to change my strategy :)  
  > **username_1**: If there's one thing I've learned in my years as a programmer, it's that if you have to jump through a bunch of hoops to do what you want to do (especially if you're working with a framework or CMS), odds are good you're barking up the wrong tree. :)  
  
  ---
  
  