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]
  • #1 / Feb 15, 2008 11:45am

    JimGoings

    44 posts

    I’m using the exclude method in my .htaccess file to make friendly URLs.

    This seems to offer me a dilima for Google though.

    Even with 404’s enabled, anything that has a valid site template in the URL will never 404 even if the page doesn’t exist.  This means that Google can’t remove dead links easily and will make my home page appear multiple times in the index, heavily penalizing my site’s rankings.

    If I turn off the friendly URLS, then I have the problem that Google doesn’t like anything after the ? as it treats it as a URI (which technically it is, but in this case holds important path information).  Thus, I get multiple entries for what (to google) seems like the same page.

    I’ll chat with my SEO guy at work to see what he thinks about the issue, but I thought you folks might know of another solution that I’ve missed entirely.

  • #2 / Feb 15, 2008 1:52pm

    Lisa Wess

    20502 posts

    Have a look at this article and especially the linked discussion. =)

  • #3 / Feb 15, 2008 2:53pm

    JimGoings

    44 posts

    I had read that earlier last night and assume that it wasn’t much use since I can still create 404’s on my home page.  Because I figured you know better than I, I just implemented the require entry and 404 code that you had on that article.

    No luck as far as I can tell.

    http://www.dragonavenue.com/dnd/thisisnotavalidpage

    I can type whatever I want after the template name (dnd) and it still just redirects to the home page.  404 works if the template is missing however.

    I think I misunderstood your post, but I’ve read it through now a couple times and am not quote understanding how the second part is supposed to work on the single entry pages and how that relates to 404’s in general.

  • #4 / Feb 15, 2008 3:02pm

    Lisa Wess

    20502 posts

    Yes, that won’t effect the template, only the entry - but if you check out the wiki links in the discussion, there is a solution for templates. =)

    The issue here is that segment 2 is extremely flexible.  It *can* be the URL title if you assume index, or category ID, again if you assume index. Or you can pass your own information and use that - so ExpressionEngine chooses not to lock you into a particular concept for that and 404s.  There is a feature request for this to be changed.

    Check out the wiki links in the comments about that post. =)

    Well, wait - I just re-read this.  Are you saying that with require_entry and no_results, and a bad url_title in segment_3, you don’t get redirected to your 404?

  • #5 / Feb 15, 2008 5:46pm

    JimGoings

    44 posts

    My home page is a multi-entry template.  My single entry is a separate template.  I put the require_entry and no_results on the single entry page as your post indicated.

    A single entry page would look like this:
    http://www.dragonavenue.com/dnd/post/4th_edition_contest_250_in_prizes/

    If I go to:
    http://www.dragonavenue.com/dnd/whatever
    it redirects to the homepage instead of showing a 404.

    However,
    http://www.dragonavenue.com/whatever
    does indeed 404 since it doesn’t have the template name in it.

    I’ll check out your links when I get home, but I’m still very confused about how your suggestion (from the blog) would help my situation.  Sorry for being obtuse… just confused. 😊

  • #6 / Feb 15, 2008 5:52pm

    Lisa Wess

    20502 posts

    What code, exactly, did you put in your single entry template?  The entire weblog entries tag would help. =)

  • #7 / Feb 15, 2008 6:40pm

    JimGoings

    44 posts

    {exp:weblog:entries weblog="{my_weblog}" limit="1" disable="member_data|trackbacks" require_entry="yes"}
                    {exp:social_bookmarks title="{title}" permalink="{url_title_path="dnd/post"}"}        
                    <div class="post">
                        <div class="post-meta">
                            <a href="/index.php/forums/member/{author_id}/">{photo_url}</a>
                            <h2>{title}</h2>
    <p>                        <a href="#comments-header" class="comment-counter-small">{comment_total}</a><br />
                            {entry_date format=' %l, %F %d, %Y %H:%i'} </p>
    
    <p>                        by <a href="/index.php/forums/member/{author_id}/class=user">{author}</a></p>
    
    <p>                        Tags: {categories}<a href="http://{path=dragonavenue_mainblog/index}">{category_name}</a> {/categories}<br />
                        </div><br />
                        <!--[if !IE]> End of post-meta <![endif]--><br />
    {if no_results}<br />
    {redirect="404"}<br />
    {/if}<br />
                        <div class="post-content"><br />
                            {if review_product_publisher}<br />
                            <div class="post-review"><br />
                                <div class="post-review-image"><a href="http://{review_product_link}">{review_product_image}</a></div><br />
                                <div class="post-review-meta"><br />
                                    /img/icons/stars_{review_product_rating}.gif<br />
                                    {review_product_rating} out of 5 stars<br />
                                    <ul><br />
                                        <li><strong>Publisher: </strong> <a href="http://{review_product_publisher_link}">{review_product_publisher}</a></li><br />
                                        <li><strong>Author: </strong>{review_product_author}</li><br />
                                        <li><strong>Released: </strong>{review_product_date format='%F %d, %Y'}</li><br />
                                    </ul><br />
                                </div><br />
                            </div><br />
                            {/if}</p>
    
    <p>                        {summary}<br />
                            <a href="http://{social_site_url}%22name=%22continue%22&gt&lt/a&gt{body}" title="Bookmark on: {social_site_name}">/themes/cp_global_images/social_bookmarks_module/favicons/{social_site_img_url}</a><br />
                            {/social_sites}<br />
                            <br />
                        </div><!--[if !IE]> End of post-content <![endif]--><br />
                    </div><!--[if !IE]> End of post <![endif]--><br />
                    <br />
                    <div id="comments-header"><br />
                        <a href="#comments-header" class="comment-counter-big">{comment_total}</a><br />
                        </p><h2>Comments</h2>
    <p>                    Say something! <a href="#comment-form">Post a comment!</a><br />
                        Unless you’re a Troll or worse, a Spam Demon, in which case we'll feed you to the Gibbering Mouthers.<br />
                    </div><!--[if !IE]> End of comments-header <![endif]--><br />
                    {/exp:social_bookmarks}<br />
                    {/exp:weblog:entries}

  • #8 / Feb 16, 2008 1:20pm

    JimGoings

    44 posts

    I realized that I may have confused things in the previous posts.  What I should have made clear is that in the following URL:

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

    dnd” is the templategroup name.  Any URL that has the template group name in it succeeds, whether or not the page is really there.

    My single entry page template is called “post” as so:
    http://www.dragonavenue.com/dnd/post/4e_halflings_design_development/

    The following URLS don’t 404 (although I’d like them too since the pages don’t exist)

    http://www.dragonavenue.com/dnd/post/4e_halflings_design_development/asdasdad
    http://www.dragonavenue.com/dnd/asdadasdgf213r

    One more point of clarification, the code above is from my single entry page “post”

  • #9 / Feb 16, 2008 2:21pm

    handyman

    509 posts

    As an SEO point which has probably already been made….

    The existing EE setup using index.php works fine - 100% picked up every day by google and other engines in my case. I doubt if it is worth the effort to clean up URLs for this reason only - but if you want them clean for your own viewing that is another story.

    My point is why fix something that is not broke, and then chance the problems with redirects, etc.?

  • #10 / Feb 16, 2008 2:23pm

    Lisa Wess

    20502 posts

    http://www.dragonavenue.com/dnd/post/adfklajd

    that does 404, so the require_entry and if no_results is working.  I didn’t confirm the headers, you’ll want to check those and make sure they’re 404, not 200.

    Currently, with ExpressionEngine engine settings, you can only check 404s on the 1st and 3rd segments.  1st for template group and 3rd for entry information.

    Many, many people pass information in segment 2 and segment 4-9, so there’s no way for ExpressionEngine to be sure that those aren’t in use.  You could request a 404 feature for those; but do please be aware that turning such a feature on would require locking down the URLs so that were not at all flexible; unlike now where the URLs are incredibly flexible.

    In my experience, people don’t tend to just manually hack away at the URL, guessing different links.  Search Engines only follow the links they find, so this doesn’t seem, to me, that it should pose that much of an issue…

    In any case, you could use PHP code to set the headers on templates, and use conditionals to test the segments (you may need PHP conditionals - an all PHP solution, to avoid parse order issues) - if you want to lock down your URLs.  Or a custom plugin could potentially be written for it.

    Just a thought. =)

  • #11 / Feb 16, 2008 3:29pm

    JimGoings

    44 posts

    Thanks, the require_entry and no_results on the post page now makes more sense to me in how it works.  The header is indeed showing a 404.

    However, one issue cropped up:

    It looks like the way the 404 redirect works on the post pages, the header and footer embeds are still being called (this is a good thing).

    However, the 404 template itself doesn’t have any embeds, so when it’s triggered because of a URL not having the template group in it, the embeds don’t appear (as expected).  However, I’d like to have the header and footer on the all 404 pages.

    Does this mean that I need to have a separate 404 template (one for single entry pages) and another for the second scenario?  If I put the header and footer on the 404 page itself, then they will be called twice on the post pages.  If so, will the following work on the post pages?

    {if no_results}
    {redirect="other404"}
    {/if}

    I hope that makes sense to you.  I think I’m 95% ready to put this issue to rest!

  • #12 / Feb 16, 2008 3:32pm

    Lisa Wess

    20502 posts

    Jim, I’m not really following.  What are the embeds that you aren’t seeing? A 404 template is really the same as any other template, EE just changes up the header when triggered as a 404 page.  If you visit the template directly, do you see your embeds?

    And no, it is only redirect=“404” - you can only set a single 404 template, which is done from the template preferences.

  • #13 / Feb 16, 2008 3:36pm

    JimGoings

    44 posts

    As an SEO point which has probably already been made….

    The existing EE setup using index.php works fine - 100% picked up every day by google and other engines in my case. I doubt if it is worth the effort to clean up URLs for this reason only - but if you want them clean for your own viewing that is another story.

    My point is why fix something that is not broke, and then chance the problems with redirects, etc.?

    I hear you.  However, there are *some* issues with SEO and URIs - but you’re right, it’s probably not worth the effort for that reason alone.  My real reason is that my partner in crime is a picky web designer that likes things “just so”. I am catering to his whim as he is a creative genius and I don’t want to disturb the sleeping monster that is helping me with the graphic design out of the goodness of his heart.

    In addition, it’s just plain pretty to clean up the URL.  I mean just look at it.  Like a princess on prom night, a sunset in Fiji, or a canoe trip at Lost Lake - it’s just too darn beautiful to destroy with “index.php?”. </dramatic prose> 😛

  • #14 / Feb 16, 2008 3:41pm

    JimGoings

    44 posts

    Lisa -

    the 404 page is empty except for a single line of text.

    The post page looks like this:

    {assign_variable:my_weblog="dragonavenue_mainblog"}
    {assign_variable:my_template_group="dragonavenue_mainsite"}
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    (lots of header mumbo jumbo here)
    </head>
    
    <body>
        {embed="dragonavenue_includes/pagetop"}
        {embed="dragonavenue_includes/post_container"}
        {embed="dragonavenue_includes/footer"}
    </body>
    </html>

    So the 404 redirect code is inside the “post_container” template.  Thus when the 404 is called from a post related 404, the “pagetop” and “footer” templates are wrapped around it.

    However, if the 404 is cause by the template group being missing (dnd) then, the pagetop and footer are not embedded.  If I did embed them on the 404 page, they would be called twice on the post pages.

    Make sense now?  Sorry for the confusion - appreciate your time (on a Saturday even!).

  • #15 / Feb 16, 2008 3:46pm

    Lisa Wess

    20502 posts

    No, it doesn’t really make sense.  See my 404 page?  This is for a single-entry page, using require_entry:

    http://lisajill.net/dem/note/akldsjfa

    That is going here:

    http://lisajill.net/dem/not-found

    as is my normal 404 page:

    http://lisajill.net/dkajff

    The redirect is a true redirect to the other template.  It should be styled however you want your 404 page to appear.

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

ExpressionEngine News!

#eecms, #events, #releases