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.

Another SEO question

February 15, 2008 11:45am

Subscribe [4]
  • #16 / Feb 16, 2008 4:01pm

    JimGoings

    44 posts

    This page:
    http://www.dragonavenue.com/assdf
    shows the entire 404 template page as expected.  No style, no header, footer, etc.  Just a blank page with a some text.

    However a post page 404 looks like this:
    http://www.dragonavenue.com/dnd/post/pagethatdoesntexist

    It is clear to me that the redirect code only changes that template, not really redirecting the browser to the template page alone.  I am confident that this is because the redirect code is within the “post_container” page which is embedded in the “post” page. 

    To be clear: the template called “post” has the post_container embedded within it.
    (I know that seems backwards - I’ll fire the guy who came up with that naming convention later)

  • #17 / Feb 16, 2008 4:03pm

    Lisa Wess

    20502 posts

    Alright, you hold on. I’m going to nuke my 404 page just for you.

  • #18 / Feb 16, 2008 4:06pm

    Lisa Wess

    20502 posts

    Try my links again, Jim.  You’ll see that it is not just *changing* the template. It is actually redirecting to the 404 template.

    I’m not really sure what is going on with your site or why you’re seeing that behavior, for it is simply not how it works. =)  Are you up for some more testing?

    If so, create a new, blank template. Put only this in it:

    {exp:weblog:entries weblog="default_site" limit="10" require_entry="yes"}
    {title}
    
    {if no_results}
    {redirect="404"}
    {/if}
    {/exp:weblog:entries}

    Give me a link to that template, please?  Make sure you replace the shortname with the real shortname.

  • #19 / Feb 16, 2008 5:24pm

    JimGoings

    44 posts

    Running out to town, but I will do this when I return later tonight!  Thanks for the help!

  • #20 / Feb 16, 2008 5:25pm

    JimGoings

    44 posts

    Also, if you like access to the admin, sign up and shoot me an email and I’ll make you an admin so you can look for yourself.

  • #21 / Feb 16, 2008 6:23pm

    Lisa Wess

    20502 posts

    Of course you know I’m already a fan and follower of your site, Jim? =)

    But we’re not at the login stage yet, set up that template and let’s see what that gives us. =)

  • #22 / Feb 16, 2008 9:02pm

    Bruce2005

    536 posts

    wiki entry may help as well. I started on this several years ago and with Derek’s help got it down ok. All url’s that are 404 return a 404 not found status as well.

  • #23 / Feb 17, 2008 5:25am

    JimGoings

    44 posts

    OK, I created the template with *exactly* the code you provided.  If I was supposed to change the weblog to one that matches my site, let me know.

    Here’s the URL:
    http://www.dragonavenue.com/dnd/lisatest

  • #24 / Feb 17, 2008 12:17pm

    Robin Sowell

    13255 posts

    OK- what I’m seeing is that any 404- be it a missing template group or a ‘fail’ on required entry results in the 404 page w/no styling.  Correct?

    If you add the embeds back to style the 404- then… what happens?

    (I think I’m vaguely confused as to what’s going on.)

  • #25 / Feb 17, 2008 2:24pm

    Lisa Wess

    20502 posts

    Robin, the curious issue is that on Jim’s site, his main template doesn’t appear to be redirecting to the 404 template,but is outputting the 404 information onto the normal template.  I can’t replicate it.

    Jim, please do update weblog= to point to an existing weblog, preferably the one for the front page of your site so I have some url_titles to work with. =)

  • #26 / Feb 17, 2008 4:38pm

    JimGoings

    44 posts

    I still feel like we’re not on the same page (no pun intended).  My single entry page is composed of several templates as described below.

    The main template (called “post”) has the HTML headers, and embeds these three other templates:

    * pagetop - Includes the header banner, menu, and login form
    * post_container - includes the single entry post weblog entries, comment form, etc.  This is also where I put the 404 code Lisa advised me about. (require entry, etc)
    * footer - the blue bar at the bottom with the copyright yada yada

    The template for the 404 has no EE code in it at the moment and is a single line of text.  What appears to be happening (and seems logical to me - although I’d like different behavior), is that only the post_container appears to be changed when the 404 occurs, and the pagetop and footer are still rendered.

    Lisa, I edited the lisatest template to point to my main weblog as requested.

  • #27 / Feb 17, 2008 4:50pm

    Lisa Wess

    20502 posts

    The template for the 404 has no EE code in it at the moment and is a single line of text.  What appears to be happening (and seems logical to me - although I’d like different behavior), is that only the post_container appears to be changed when the 404 occurs, and the pagetop and footer are still rendered.

    The issue is that this isn’t how ExpressionEngine 404s work.  If your no_results is met, it should *redirect* you to a 404 page, which is what it does on my installation.  Remember, ExpressionEngine doesn’t know what goes where in your template - there’s no way for it to do a replacement in the way you describe.

    Ok - so this works as expected:

    http://www.dragonavenue.com/dnd/lisatest/dungeon_master_screen_of_ultimate_doom/

    and this brings up a 404 message:

    http://www.dragonavenue.com/dnd/lisatest/dkasjfadsf

    However, your belief is it’s changing the actual template rather than redirect.  So, on lisatest, add something like this, outside of the weblog entries tag:

    This is the single-entry page

    what we should see now is that the second link with garbage in the third segment should *not* include the added text, but that the first link with a real url title will include the added text.

    Make sense?

  • #28 / Feb 17, 2008 5:04pm

    JimGoings

    44 posts

    Makes sense, and it does indeed behave as you predicted.  So why does the real post template have different behavior?

    This link shows the weird behavior
    http://www.dragonavenue.com/dnd/post/a123123

  • #29 / Feb 17, 2008 5:10pm

    Lisa Wess

    20502 posts

    Your actual post template is simple, but you’ve got a few embeds.  Unfortunately, the next job is to isolate what is going on, which means reducing that template until you have the bare minimum that replicates this behavior.

    You don’t want to disturb your main page, so what I would recommend doing is copy your entire post template into lisatest or similar, then take out everything except the weblog entries tag.  Put that directly in the template and see if things behave, then move it into the embed and see if that works.  Slowly add things back until you find out what the culprit is.

    Unfortunately tedious work, but necessary to figure out what is going on here.

  • #30 / Feb 17, 2008 5:19pm

    JimGoings

    44 posts

    Roger Wilco.  Sounds like a good plan.  I’ll do it after I shower and catch up on some Lost.

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

ExpressionEngine News!

#eecms, #events, #releases