1

How can I implement the following routing structure:

pattern: /{category}

yet also have many other fixed patterns such as

pattern: /register
pattern: /login
pattern: /help

I know one way is to require regex for the category variable so that category is not equal to any of the fixed patterns. However, if I were to have 50+ different fixed patterns for the system, it would become a bit messy. Is there a clean and effective way to implement this routing structure?

I DO NOT want to compromise doing something like:

pattern: /something/{category}

1 Answer 1

4

Simply place

pattern: /{category}

in the end of the routing.yml

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

1 Comment

But beware if you add anything to URL that is provided by user (even an administrator), as you can create a page that's impossible to display.

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.