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.

404 Issues Across Multiple Templates

January 19, 2011 1:25am

Subscribe [3]
  • #1 / Jan 19, 2011 1:25am

    Spark Creative

    28 posts

    This question may be related to a resolved thread.

    Hey there,

    I have spent hours trying to find a solution to this issue, with no luck. I am a bit disappointed that EE doesn’t have the built in capabilities to deal with 404’s the way the other systems do - namely WP (which I loath). I love EE but am having a hell of a time getting this to work…

    Ok, I have a main blog page - shows 4 blog posts at a time, which then has pagination to see more and more etc… When I try to implement the following, the pagination throws a 404:

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

    I have the same problem when a category is clicked since the URL changes to:

    /blog/category/{url_title}

    So, how can I stop crap like /blog/get-a-life from happening while also tackling /blog/P4/this-sux, and /blog/category/go-suck-an-apple??

    I have tried adding on:

    {if segment_2!= '' && segment_2 != 'category'}
      {redirect="404"}
    {/if}

    But that doesn’t help the pagination problem. I seem to just be going in a huge circle trying to cover all of my bases. Is there a way to cover pagination and categories all at one time without having to create more templates?

    Is there a way to target pagination like you can for category? This just seems to be so much more difficult than it should be.

    Is there anything that can be done here? I have been over loads of other support threads for this, but nothing seems to work. Please help! I am desperate!!  🐛

    Thanks in advance!! And help that can be offered will be much appreciated.

    Danielle

  • #2 / Jan 19, 2011 1:36am

    Spark Creative

    28 posts

    By the way, I am using v2.1.3, I have strict URLS turned on, and have removed the index.php from my URLs. Thx!

  • #3 / Jan 19, 2011 4:23pm

    Ingmar

    29245 posts

    Have you considered using require_entry=“yes” together with a conditional?

  • #4 / Jan 19, 2011 7:16pm

    Spark Creative

    28 posts

    Hey Ingmar,

    Yes, I have tried a number of different combinations with nothing working 100% - I can get it going for categories and such, but then it won’t work with pagination. Here is my code if that helps for this page:

    
    
    

    You can see this page live here: http://tinyurl.com/6afpomq

    As you can see, clicking on the categories in the sidebar or using the pagination links affect the url quite a bit. How can you cover all the bases? Any help you could provide would be fantastic! Thanks!

    Danielle

  • #5 / Jan 20, 2011 8:53am

    Sue Crocker

    26054 posts

    You can’t cover all the bases, how frequently are bogus categories going to be entered?

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

ExpressionEngine News!

#eecms, #events, #releases