1

Urls go like

domain/approved/education/kids/ and so-on

but I also have filter page in place that lets you do this

domain/approved/education-entertainment-business/kids/ and so on

which means list all kids articles no matter what Level1 category they fall in.

But that also means that

domain/approved/education/

and

domain/approved/education/kids-teenager-adult

list exactly the same content (assuming level2 only has 3 categories - kids, teenager and adult). How to handle duplicacy in this case? for the sake of canonical url and so on.

Also, My sitemaps should not worry about filtering URLs at all, right?

this is the route my thing is hitting and it should be hitting.

routes.MapRoute("DefaultRoutesWithParams",
             "{action}/{category}/{ageGroup}/{gender}",
             new { controller = "Home", category = "", ageGroup = "", gender = "" },
             new { action = new homeActionConstraint() });
TPR
  • 2,567
  • 10
  • 41
  • 65
  • This is probably pedantic, but do you mind placing real URLs, not the domain part. Just example data, I think people would respond easier if they don't have to parse your cat1 cat2 cat3 mumbo jumbo. Use actual category names as an example for us. – Only Bolivian Here Jan 22 '12 at 02:52

1 Answers1

0

The order in which routes are registered matters. Try reorganizing them.

Mario J Vargas
  • 1,185
  • 6
  • 12
  • Not getting what you meant. Can you elaborate? – TPR Jan 22 '12 at 04:06
  • Try posting the code where your routes are being registered, usually in the Global.asax. Maybe others or I will better see what the issue may be. You probably have something that looks like this: `routes.MapRoute("RouteNameHere", "{controller}/{action}/id", new { controller = "DefaultControllerHere", "DefaultActionHere", id = "" });` Post the complete list of those registrations here or if you want to try it out first, reorder them in your code to see if this solves the issue. See: [link](http://msdn.microsoft.com/en-us/library/cc668201.aspx#adding_routes_to_an_mvc_application) – Mario J Vargas Jan 22 '12 at 04:18
  • Done. I used route debugger to see what routes are being hit. – TPR Jan 22 '12 at 08:50
  • Thanks for the detailed question. Maybe the dashes are the problem. I happened to stumble upon this post under the "Related" section to the right of your question: [Asp.Net MVC: How do I enable dashes in my urls?](http://stackoverflow.com/questions/30310/asp-net-mvc-how-do-i-enable-dashes-in-my-urls) – Mario J Vargas Jan 22 '12 at 22:02
  • I'm sorry, but you seem completely off-topic (unless I am misunderstanding you). I don't blame you, this question itself seems very off-topic for stackoverflow. I'm going to post it on webmasters.stackexchange.com – TPR Jan 23 '12 at 00:34
  • Sorry I couldn't be of much help. Yes, this is a tricky one. Post back here if you get an answer or resolution on your own. Did you take a look at the link I included? – Mario J Vargas Jan 23 '12 at 00:40