0

A site uses this link format for everything:

  • example.com/?article=123
  • example.com/?category=456
  • example.com/?article=789&picture=012

An ASP classic default.asp catches all of this and does stuff with it.

I would really like to create a couple of routes for these old type of Url's with querystrings on the root, so I can catch them in a separate controller and do some tricks on them (permanent redirects).

When I try to create a route that contains a questionmark, I am told that is not possible.

1 Answer 1

1

This could be a good case for Global Action Filters if there's no way to handle these using routes (Although I imagine there is).

You could process the incoming url in the OnActionExecuting method and redirect as appropriate.

UPDATE

There's a good SO answer here on how to redirect as you require. It may not be exactly as you've asked however a similar principle should acheive what you're after quite easily.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.