1

I have a website that is generating /category pages and /taxonomy archive type pages, with a list of posts containing a certain taxonomy term. I do not have a template for this page and they seem unnecessary/duplicate content. Is there any way to prevent them from being created?

category/region/all/boston?page=2&region=DEFAULT /taxonomy/term/14/”?page=19&region=DEFAULT

link to one of these pages http://nyc.thedelimagazine.com/taxonomy/term/14/%E2%80%9D?page=19&region=DEFAULT

1

If you really want to prevent the URLs from existing at all, you could probably unset the paths using a hook_menu_alter. I would be careful with that though, as it might have unforseen consequences. The creating module may in some way depend on the paths existance.

I don't know where the category paths comes from but I guess the answer will be the same as for the taxonomy ones.

My solution would be to take over the URL with Page manager, and simply pass the user a redirect to the front page. (Or a 404, if you prefer). Note that I'm talking about "Page manager" in Ctools, not Panels. The two modules are often confused and their names interchanged.

  • I already created a module using hook_nodeapi for 301 redirects given certain cases for different urls. should I just add a new case to this instead of installing another module? Where are these pages stored in the database, I was trying to keep them from being created and complicating the site. – albo Jan 2 '12 at 18:47
  • If you already have a hook_nodeapi, then it's easy to stick with that. I could make a case for PM anyway, but I think that's out of scope. Only the "root" path is stored, such as "taxonomy/term/", the arguments specific paths such as "taxonomy/term/14" is created on the fly. Try a query like: "SELECT * FROM menu_router WHERE path LIKE "taxonomy/term/%";" and you'll find them. These are the entries you can prevent from showing up with hook_menu_alter. – Letharion Jan 2 '12 at 18:58
  • thanks, I think I will do: if (arg(0)== 'taxonomy') { drupal_goto()} – albo Jan 2 '12 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.