I have a problem with one template after enabling Strict URLs - it returns 404 instead displaying content from the channel named News. The URL to open that template is like http://www.mydomain.com/index.php/news/

Template code:

<div id="wrapper">
  <div id="content">
            <div id="content_main">
                      {if segment_2 == ''}
                         {exp:channel:entries channel="news"}
                            <h1 class="orange">{title}</h1>
                            <a href="/index.php{page_uri}">Read more</a>
                            <br /><br /><br />
                         {exp:channel:entries channel="news"}
                            <h2 class="bigorange">{title}</h2>
                            <p><a href="/index.php/nm">Back to news</a></p>
            <div id="content_sub_buttons">
                <div style="background-image: url(/uploads/images/doc_photo.png); width:212px; height: 199px;">
                <div style="padding-top: 12px; padding-left: 15px;">
                {exp:random_number min="1" max="6"}
                <img src="/uploads/images/kids/{random_number_0}.png">
            <div class="clear">&nbsp;</div>

Any clue why is not loading that template?


  • Please, what is the URL you're trying to open?
    – Sobral
    Commented May 30, 2013 at 16:43
  • An example of URL added to the OP Commented May 30, 2013 at 16:48

2 Answers 2


Strict URL is working exactly how it is supposed to for you. From the EE blog:

With Strict URLs disabled, it’s possible to visit http://example.com/about-us/ and view that content. But you can also visit http://example.com/site/about-us/ and get the exact same content. This flexibility can be advantageous, but it comes with a price: dual availability can cause search engines to lower the content’s ranking.

With ExpressionEngine 2.6 and up, Strict URLs will be enabled by default in new installations. Using the same example, http://example.com/site/about-us/ is the only valid URL for that content. Visiting http://example.com/about-us/ with Strict URLs enabled will trigger ExpressionEngine’s defined 404 behavior.

If you have site/news as a template and strict URLs enabled, you can't access the news template with index.php/news. You have to have index.php/site/news.


Can you see if this does anything for you? Change your complex conditional to two simple conditionals:

{if segment_2 == ''}news home{/if}
{if segment_2 != ''}news listing{/if}

In your example of http://www.mydomain.com/index.php/news/ you need to make sure that news is set as you default template group and that it contains a template called index. Otherwise you have to explicitly declare the template_group/template in the URL.

  • Well, it looks like I have a problem with default template group, which has all-in-one catch-all /site/ group for all templates, including index and news. When I use http://www.mydomain.com/index.php/site/news/ it works as should. In that case I have used .htaccess RewriteRule to point to proper URL for that one case. Commented May 30, 2013 at 19:01
  • So site is your Default Group and you have ticked Make the index template in this group your site's home page?? If not then you'll need to do this or specify the template along with the template group.
    – Ian Young
    Commented May 30, 2013 at 19:25
  • Which version of EE is this btw?
    – Ian Young
    Commented May 30, 2013 at 19:25
  • Correct - 'site' is a default template group and 'index' template is a home page there. Commented May 30, 2013 at 19:35
  • I'm on EE 2.5.4 Commented May 30, 2013 at 21:05

Your Answer

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

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