I want to remove template name from URL. I want to display only template_group/entry-name. Is this possible?

  • Possible duplicate of Remove template segment from URL. Also see Strict URLs / Removing one template group name
    – Alex Kendrick
    Oct 15, 2013 at 12:39
  • Alex - both those questions refer to removing the template group, which is very different to removing the template name. Albeit both can be resolved with similar add-ons, the native solutions would be quite different, so justifies a separate question. Oct 15, 2013 at 16:29
  • I misinterpreted the question. Close vote retracted and +1 for your answer @PeterLewis ;)
    – Alex Kendrick
    Oct 15, 2013 at 20:47

3 Answers 3


You can use the Template Routes plugin to override the default routing.

You'd add something like this to your index.php:

$config['template_routes'] = array(
  'template_group/:any' => 'template_group/template_name'

and then just do something with the $1 value in the template.


As Robson & Bhashkar have stated, use the index template in the template group to do the channel:entries tag pair - therefore doing away with the template reference in the URL. If you target template_group, it automatically uses the index template without you specifying /template_group/index.

You're trying to utilise the same template (template_group/index) for both the listing and the details - that's absolutely fine, just utilise no_results...

Let's assume template_group is "blog", the URLs you want are:

  • /blog (listing)
  • /blog/my-article (details - not /blog/details/my-article)

Assume you're accessing the entry details first, so blog/index template:

    {if no_results}

... display of blog details page   ...


This will attempt to pull an entry based on the URL - if it can't match it, it will fall into the no_results conditional and embed the listing page...

Template blog/listing (note this template isn't the URL!)

    paginate="bottom" paginate_base="/blog"

    ...listing details...

The easiest way will be just put the code within the "index" template of that template group. By doing it, you can have the URL like template_group/entry-name.

  • @ Bhashkar sir i am already using "index" template for article list page and for article detail page i am using template_group/template/article-name so now i want to remove details and i want to use template_group/article_name now how this is possible ? Oct 15, 2013 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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