title: Nextjs dynamic routing exclude
body: <p>Is there a way of excluding some dynamic routs in next.</p>
  
  <p>Header component:</p>
  
  <pre class="lang-js prettyprint-override"><code>export const DynamicCatPageLinks = () =&gt; {
    const router = useRouter();
  
    const relPath = router.route
    const { tv } = router.query
  
  
    return (
      &lt;Query query={CategoryList}&gt;
        {({ loading, error, data }) =&gt; {
          if (loading) return &lt;h2&gt;Loading...&lt;/h2&gt;;
          if (error) return &lt;h1&gt;Error fetching the post!&lt;/h1&gt;;
          return (
            &lt;&gt;
              {data.category.map(cat =&gt; (
                &lt;li key={cat.id}&gt;
                  &lt;Link href=
                      {`/${tv}/category/page/${cat.slug}`}
                  &gt;
                    &lt;a category={cat.slug}&gt;{cat.name}&lt;/a&gt;
                  &lt;/Link&gt;
                &lt;/li&gt;
              ))}
            &lt;/&gt;
          );
        }}
      &lt;/Query&gt;
    );
  };
  
  </code></pre>
  
  <p>Page Hierarchy</p>
  
  <pre><code>-pages
    -[tv]
     -category
     ...
  </code></pre>
  
  <p>So the url is: [tv]/category/page/...</p>
  
  <p>Is there a way of limiting the values that can be passed to the [tv] route</p>
  
  <p>So that the url can be, example:</p>
  
  <pre><code>television1/category/page/...
  television2/category/page/...
  television3/category/page/...
  ...
  </code></pre>
  
  <p>But if you do something like this:
  <code>unknown/category/page/...</code></p>
  
  <p>It renders a different page like 404 as example?</p>
  
  <p>Thank you.</p>