# Controller Routing

**URL:** <https://forum.shopware.com/t/controller-routing/68857>\
**Category:** Programmierung\
**Created:** [8. August 2020 um 10:22 UTC](https://forum.shopware.com/t/controller-routing/68857 "2020-08-08T10:22:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_Dev](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@M\_Dev](https://forum.shopware.com/u/M_Dev)\
**Post date:** [8. August 2020 um 10:22 UTC](https://forum.shopware.com/t/controller-routing/68857/1 "2020-08-08T10:22:33Z")

</div>

Hey Leute.&nbsp;  
Ich habe eine Frage zum Routing.

Ich will einen CustomController schreiben, der sobald an der Produktnummer ein “?t=” dranhängt etwas macht und dann einfach auf die Seite weiterleitet.

Also im DemoShop zb kann man ja auf ein Produkt klicken und landet dann zb bei: [http://swplugin1.test/Awesome-Leather-PowerPotato/243ec251024d4828aa11753bee5b6e51](http://swplugin1.test/Awesome-Leather-PowerPotato/243ec251024d4828aa11753bee5b6e51)  
Ich will nun einen Controller schreiben, dass wenn zb:&nbsp;[http://swplugin1.test/Awesome-Leather-PowerPotato/243ec251024d4828aa11753bee5b6e51](http://swplugin1.test/Awesome-Leather-PowerPotato/243ec251024d4828aa11753bee5b6e51)f?=whatever geklickt wird ich auch auf dem gleichen Template lande wie&nbsp;[http://swplugin1.test/Awesome-Leather-PowerPotato/243ec251024d4828aa11753bee5b6e51](http://swplugin1.test/Awesome-Leather-PowerPotato/243ec251024d4828aa11753bee5b6e51)&nbsp;aber noch etwas an Logik passiert.

Ich hoffe jemand kann mir helfen oder zumindest die Richtung geben, weil ich habe schon folgendes Probiert

```
 \* @Route("/{productName}/{productID}/{nextWildcard}", name="swplugin1.test", methods={"GET"}) Das geht aber so nicht, weil der Slash zuviel ist und ich auch mit Strcontains nicht nach ?t= oder ähnlichem suchen kann. 

 \* @Route("/{productName}/{productID}?t=", name="swplugin1.test", methods={"GET"}) hat ebenfalls nicht funktioniert. Außerdem weiß ich nicht, wie ich in einem Custom Controller auf die Seite redirecte, wo ich grade bin. Vielen Dank im Vorraus!
```
