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.

A quick question about URLs

October 10, 2012 6:36pm

Subscribe [2]
  • #1 / Oct 10, 2012 6:36pm

    Rick Lecoat

    128 posts

    Am I correct in thinking that if a template is in the same template group as the site index page, that one can omit the template group from the URL and it will still work?

    Example: my site index is site/index. The URL for the site index page simply needs to be http://www.mydomain.com without the need for either template group or template. But also in the ‘site’ template group are the templates ‘search’ and ‘404’. Do the URLS for these templates need to be (eg.) http://www.mydomain.com/site/search or will http://www.mydomain.com/search be sufficient?

    My local tests seem to indicate that the template group can be omitted (if it is the template group containing the site index page) and the URLs will still work, but I want to be sure that my results are not a temporary fluke that will bite me further down the line. (Yes, I could just include ‘site’ to be on the safe side, but I’d prefer not to have it cluttering up the URL if I can help it since, unlike other template groups (events, blog, etc), it doesn’t carry any meaning with regard to the content of the page it represents).

  • #2 / Oct 11, 2012 8:30am

    Boyink!

    5011 posts

    Did your testing including turning on strict URLs?  That setting may affect the “leaving out the template group name” behavior.

    I typically just throw search into their own template group since I often have both results and no results templates.

  • #3 / Oct 12, 2012 2:21pm

    Kevin Smith

    4784 posts

    Hey Rick,

    This is a great question! If…

    1. Strict URLs aren’t enabled, and
    2. The first segment found in the URI isn’t the name of a template group, and
    3. The first segment is the name of a template in your default group

    Then yes, EE will show that template from your default group. That’s not a fluke or anything, it’s baked right into the template engine. Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases