Redirect taxonomy term links to a views page

On some Drupal sites having the taxonomy links point to the "taxonomy/term/tid" can really break the design of a site. Sometimes you want to redirect the user to a custom views page instead of the standard taxonomy page.

Using the Taxonomy Redirect module it's relatively easy to change the taxonomy URL.

To install Taxonomy Redirect go to http://drupal.org/project/taxonomy_redirect and download the module. Unzip the module into "sites/all/modules".
Once installed go to Administer >> Site Building >> Taxonomy Redirect to create your redirects.

fig 1

For this example I have created a views page which passes the taxonomy ID via the URL (stories/!tid).

So if I go to URL example.com/stories/1 it will show all nodes which have been taged with taxonomy ID 1.

fig 2

To create the redirect just go to Administer >> Site Building >> Taxonomy Redirect.

Under the Add new redirect, select the vocabulary you want to redirect.

fig 3

Then in the Path text field enter in "stories/!tid". The system will replace "!tid" with the taxonomy term ID.

fig 4

Scroll down to the bottom and click on Submit. If you need to edit any redirects just click on the load into editor link.

fig 5

Now if you go and click on any taxonomy terms they all should redirect to "stories/!tid" instead of "taxonomy/term/!tid".

If you have any feedback or need help please leave a comment.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <pre> <h2> <h3> <h4> <h5> <h6> <hr> <blockquote> <p> <br>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.

More information about formatting options