We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Why EE parsing not existed URL segments?

How Do I?

web-admin's avatar
web-admin
20 posts
6 years ago
web-admin's avatar web-admin

Hi guys,

I have a problem that I cannot explain. I created URL like this: domain.com/lang/segment_1/segment_2/segment_3 (segment_3 is a “url_title”). Also I used combination of if statements to avoid loading not existed urls (example below).

{if segment_4}{redirect="404"}{/if}
{if segment_2 != "segment_2"}{redirect="404"}{/if}
{if segment_2 == "segment_2"}
{if segment_4 == ""}

  {exp:channel:entries channel="channel_name" require_entry="yes" url_title="{segment_3}" dynamic="no" limit="1" disable="categories|member_data|pagination"}
    {if no_results}
    {redirect="404"}
    {/if}
    ...
  {/exp:channel}

{/if}
{/if}

Everything works fine. If I add any segment_4 then I get 404 page as expected. But… If I also add segment_5 (and segment_6, segment_7 later on) then I do not get 404 page. Instead of that browser trying to load “something” and finally I get 504 page (from ClaudFlare). Interesting fact is that the problem occurs ONLY when the last segment is “utl_title”.

Question is: why I do not get 404 page when adding not existed segments? It’s really anoying me as I don’t have idea what’s wrong.

I’m using EE 3.5.16 (Strict URLs enabled).

Thanks for your help!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.