ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to hide Single Entry template in URL?

September 29, 2010 5:09am

Subscribe [1]
  • #1 / Sep 29, 2010 5:09am

    macpro

    85 posts

    Hi EE User,

    i just need a wake up. My last EE development is far away. I want to achive the following:

    My setup looks this now -> http://www.example.com/templategroup/template/singelentry
    This is what I want -> http://www.example.com/templategroup/singelentry

    Since the index of the template group template shows the list of the entries and the single entry template, right, you named it, just the single entry.

    There are three ways, wich I think are possible:
    1. Setting Comments path in the backend to the templategroup, or
    2. using the {if segment !=""}show only one entry{/if}, or
    3. via htaccess

    Any thoughts?

    Stefan

  • #2 / Sep 29, 2010 9:55am

    ender

    1644 posts

    htaccess is by far the best.  EE’s template tag parsing issues make having one template to run both the list view and detail view very awkward (though it is doable if you really want to).

    RewriteCond $0 !^(?:index\.php/)?templategroup/(?:template) [NC]
    RewriteRule ^(?:index\.php/)?templategroup/([^/]+)/?$ /index.php/templategroup/template/$1/ [L,NC]
  • #3 / Sep 30, 2010 6:23pm

    macpro

    85 posts

    Hi ender,

    thank you for the hint. I will give it a try.
    Or do you think, that to solve this via {if} statement, the server gets to busy and in terms of 404 it won’t work a clean way too?

    stefan

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases