Thread

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

The active forums are here.

Odd problem with broken URLs and no headers

March 19, 2012 8:08am

Subscribe [1]
  • #1 / Mar 19, 2012 8:08am

    danieljohnbarnes

    151 posts

    Having an odd problem with EE URLs!

    Normal stat of play are URL’s like this:

    <a href="http://www.domain.com/template_group/template/url_title/">http://www.domain.com/template_group/template/url_title/</a>
    
    <a href="http://www.domain.com/template_group/c/category_name/">http://www.domain.com/template_group/c/category_name/</a>

    Using conditionals in “template” easy to deal with requiring entries and 404’s.

    However, due to some errant markup in some sites linking in, URLs like the following are being hit where the anchor text is truncated but the active link is also directing towards the truncated URL:

    <a href="http://www.domain.com/template_group/.../url_title/">http://www.domain.com/template_group/.../url_title/</a>

    The url_title is valid, but the “template” is replaced by ‘...’ so this URL is processed by template/group/index rather than the “template”. As a result, EE returns the markup but with no headers so nothing is rendered even though the source code shows the markup.

    What’s the best way to go about stopping this happening (without being too specific to the ... case) but still allow regular scenarios to work (including any pagination):

    <a href="http://www.domain.com/template_group/">http://www.domain.com/template_group/</a>
    <a href="http://www.domain.com/template_group/c/category_name/">http://www.domain.com/template_group/c/category_name/</a>
  • #2 / Mar 20, 2012 10:20am

    danieljohnbarnes

    151 posts

    Was running a little slow yesterday. It was a simple:

    (segment_2!=="" && segment_2!=="c")

    Wish there was a way without using a conditional in the template though.

ExpressionEngine News

#eecms, #events, #releases