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.

remove index and template group

August 16, 2013 3:24pm

Subscribe [3]
  • #1 / Aug 16, 2013 3:24pm

    Marcuse

    166 posts

    Can i remove the template group name to? I yes I can build a hole site from one template file

    something like this (not working)

    <IfModule mod_rewrite.c>
          RewriteEngine On

          # Removes index.php from ExpressionEngine URLs
          RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ /templategroup/index.php/$1 [L]
    </IfModule>

  • #2 / Aug 16, 2013 4:44pm

    Rob Allen

    3105 posts

    Why not just use some conditionals in your main template group’s index template:

    {if segment_1 == ""}
    Home page
    {/if}
    
    {if segment_1 == "blog"}
    
        {if segment_2 !="post"}
        Blogs listing
        {/if}
    
        {if segment_2 == "post"}
        Blog entry
        {/if}
    
    {/if}

    etc…

    There have been some blog posts that deal with a single template approach, I can’t remember where they were now but perhaps someone knows?

  • #3 / Aug 18, 2013 7:25am

    fdelaneau

    3 posts

    I just build a site that relies heavily on one template and used the approach described by Rob.

    As long as you have a limited number of choices it works perfectly.

    Depending on what you need you can use Switchee (http://devot-ee.com/add-ons/switchee), it will make your code more readable and faster to parse.

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

ExpressionEngine News!

#eecms, #events, #releases