2

I have a channel type entry where I'm inserting services. I have created a channel and add route services/{slug} and added template services\_entry.twig. I want to keep url for single service as services/single-service but want to disable "services" route.

For example:

localhost/services/single-service    // Need to keep it
localhost/services                   // Need to disable

Is it possible in Craft CMS?

1 Answer 1

3

Craft doesn't have any default routes for the frontend. So if you're seeing anything else than a 404 page on your /services route, it's because you've put something there. The routing documentation has a list of possible sources for the content you're seeing for that route. Most likely, you have either:

  • a section with an entry that has services as its URI
  • a template called services.twig in your templates folder
  • or a route matching that URL (defined in the backend or in config/routes.php)

To remove the /services route from the frontend, use the list linked above to find out where it's coming from and then disable it.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.