I have a virtual node name product and I also have a controller named ProductController that has an action method called GetProduct. GetProduct takes a parameter called id which is the id of the product to get from the database. My route is configured as product/{id}, so when I click to see a specific product, I get something like this in the url:
I tried removing product from my route configuration, but then if I go to any page such as http://localhost/blog or http://localhost/support, it thinks those those pages are product pages and tries to hit the product controller.
Hide controller name on virtual routes?
Hi,
I have a virtual node name
product
and I also have a controller namedProductController
that has an action method calledGetProduct
.GetProduct
takes a parameter calledid
which is the id of the product to get from the database. My route is configured asproduct/{id}
, so when I click to see a specific product, I get something like this in the url:http://localhost/product/abc
Is there a way to have the url be
http://localhost/abc
.I tried removing
product
from my route configuration, but then if I go to any page such ashttp://localhost/blog
orhttp://localhost/support
, it thinks those those pages are product pages and tries to hit the product controller.is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.