0

In EE 1.6.9, I've got two weblogs running on the same installation. Both use the same domain name as the base, but are different blogs. What I've found is that posts from the main blog are bleeding over into the sub blogs, so that Google is indexing the secondary site. Here's an example:

The first URL is the main site, where the post was actually published:

http://www.golfblogger.com/index.php/golf/comments/hyundai_genesis_test_drive_report/

The second is where it strangely bleeds over.

http://www.golfblogger.com/index.php/shopgolf/comments/hyundai_genesis_test_drive_report/

If I search the shop weblog from my control panel, the second page doesn't show up. Yet it appears in search engine results.

How do I keep the main site (first URL) from bleeding over to the other? I'm sure this is screwing up my search engine credibility.

As requested below, here is the EXP: Weblog code for the main site:

 {assign_variable:master_weblog_name="weblog1"}
    {assign_variable:template_group_name="golf"}

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset={charset}" />
    <meta property="og:image" content="http://www.golfblogger.com/images/uploads/GolfBlogger_sm.jpg"/>


    {exp:weblog:entries limit="1" rdf="off" disable="trackbacks|member_data|pagination|comments"}
    {Metatags}
    <title>
    {if customh1 != ""}
    {customh1}
    {if:else}
    {title}
    | {/exp:weblog:entries}Golfblogger: Michigan Golf Blog Featuring Golf Reviews, Golf Opinion and Golf Essays.
    {/if} 

    </title>

    {embed="includes/header"}
    </head>

    <body id="secondary-page" class="comments-page">
    {embed="includes/design_top"}
         <div id="primarycontent">

    {exp:weblog:entries limit="1" rdf="off" disable="pagination"}

    <h2>{title}</h2>

    <div class="blogentry">
    <span class="date">{entry_date format="%F %j, %Y"}</span>
    {summary}
    <span class="class2">
    {body}
    {extended}
    </span>
    </div>
    <h8><b>Posted By {author}</b></h8>
    <br>

    <p>
    <h3>Golf Blog Category:<br />
    {categories weblog="{master_weblog_name}" backspace="7"} <a href="{path={template_group_name}/golfing-blog/}" title="Browse articles in {category_name}">{category_name}</a>,&nbsp;{/categories}
    </h3>


    <h4>Interact:<br />
    <a href="{title_permalink="{template_group_name}/comments"}" title="Permalink for {title}">Permalink</a> | 
    <a href="http://www.golfblogger.com/index.php/golfforums" title="Golf Forums">Start a Forum Post on this topic or other golf topics</a> | 
    <a href="#" onclick="window.open('{permalink={template_group_name}/friend}', '_blank', 'width=400,height=650')">Email this entry</a>
    </h4>

    <p> 

    <div id="comments">
    <h2>Comments</h2>
    {exp:weblog:entries weblog="{master_weblog_name}" rdf="off"}
    {if comment_total == 0}
    <p>No comments yet.</p>
    {/if}
    {/exp:weblog:entries}

    <ul>
    {exp:comment:entries}
    <li>{comment}
    <p class="comment-posted">Posted by <a href="{url}"> {name} </a> on {comment_date format='%m/%d'}</p>
    </li>
    {/exp:comment:entries}
    </ul>

    <h2>Post a Comment:</h2>
    Note: All comments are moderated. Spam comments simply will not get through. So don't bother.<p>
    {exp:comment:form preview="{template_group_name}/preview"}

    <dl class="commentsforminput">

    <dt>Name</dt>
    <dd><input type="text" name="name" value="{name}" size="30" class="commentinput" /></dd>
    <dt>Email</dt>
    <dd><input type="text" name="email" value="{email}" size="30" class="commentinput" /></dd>
    <dt>Location</dt>
    <dd><input type="text" name="location" value="{location}" size="30" class="commentinput" /></dd>
    <dt>URL</dt>
    <dd><input type="text" name="url" value="{url}" size="30" class="commentinput" /></dd>
    </dl>

    <p>
    <a href="{path={template_group_name}/smileys}" onclick="window.open(this.href, '_blank', 'width=400,height=440');return false;" onkeypress="this.onclick()">Smileys</a>
    </p>

    <p>
    <textarea name="comment" cols="50" rows="12">{comment}</textarea>
    </p>

    {if not_logged_in}
    <p><input type="checkbox" name="save_info" value="yes" {save_info} />Remember Me?</p>
    {/if}

    <p><input type="checkbox" name="notify_me" value="yes" {notify_me} />Email Me When Someone Else Comments?</p>

    {if captcha}
    <p>Submit the word you see below:</p>
    <p>
    {captcha}
    <br />
    <input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
    </p>
    {/if}

    <input type="submit" name="submit" value="Submit" class="submit-button" />
    <input type="submit" name="preview" value="Preview" class="submit-button" />
    {/exp:comment:form}
    </div><!-- end comments -->



         </div><!-- end primarycontent-->
         <hr />

    {embed="includes/secondary_sidebar"}

    {embed="includes/footer"}


    </body>
    </html>

And for the one it is bleeding over to:

{assign_variable:master_weblog_name="ShopGolfBlogger"}
{assign_variable:template_group_name="shopgolf"}


<!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>
<meta http-equiv="Content-Type" content="text/html; charset={charset}" />

<title>

{exp:weblog:entries limit="1" rdf="off" disable="trackbacks|member_data|pagination|comments"}
{if customh1 != ""}
{customh1}
{if:else}
{title}
| {/exp:weblog:entries}Golfblogger Golf News, Reviews and Commentary
{/if} 

</title>

{embed="shopgolfincludes/header"}
</head>


<body id="secondary-page" class="comments-page">
{embed="shopgolfincludes/design_top"}
     <div id="primarycontent">

{exp:weblog:entries limit="1" rdf="off" disable="pagination"}


<h2>{title}</h2>

<div class="blogentry">

{summary}
<span class="class2">

{body}

{extended}

{exp:magpie url="{RSS_URL}" limit="50" refresh="30"}

{magpie:items}
<li>
<a href="{magpie:link}">{magpie:title}</a><br>
{magpie:description}<p>
{magpie:about}<p>


</li>

{/magpie:items}


{/exp:magpie}

</span>
</div>


<h3>Golf Blog Category:<br />
{categories weblog="{master_weblog_name}" backspace="7"} <a href="{path={template_group_name}/golfing-blog/}" title="Browse articles in {category_name}">{category_name}</a>,&nbsp;{/categories}
</h3>

<h4>Interact:<br />
<a href="{title_permalink="{template_group_name}/comments"}" title="Permalink for {title}">Permalink</a> | 
<a href="http://www.golfblogger.com/index.php/golfforums" title="Golf Forums">Start a Forum Post on this topic or other golf topics</a> | 
<a href="#" onclick="window.open('{permalink={template_group_name}/friend}', '_blank', 'width=400,height=650')">Email this entry</a>
</h4>

<h2>Add Your Review of the {title} below:</h2>

<div id="comments">
<h2>Comments</h2>
{exp:weblog:entries weblog="{master_weblog_name}" rdf="off"}
{if comment_total == 0}
<p>No comments yet.</p>
{/if}
{/exp:weblog:entries}

<ul>
{exp:comment:entries}
<li>{comment}
<p class="comment-posted">Posted by {name} on {comment_date format='%m/%d'}</p>
</li>
{/exp:comment:entries}
</ul>

<h2>Post a Comment:</h2>
{exp:comment:form preview="{template_group_name}/preview"}

<dl class="commentsforminput">

<dt>Name</dt>
<dd><input type="text" name="name" value="{name}" size="30" class="commentinput" /></dd>
<dt>Email</dt>
<dd><input type="text" name="email" value="{email}" size="30" class="commentinput" /></dd>
<dt>Location</dt>
<dd><input type="text" name="location" value="{location}" size="30" class="commentinput" /></dd>
<dt>URL</dt>
<dd><input type="text" name="url" value="{url}" size="30" class="commentinput" /></dd>
</dl>

<p>
<a href="{path={template_group_name}/smileys}" onclick="window.open(this.href, '_blank', 'width=400,height=440');return false;" onkeypress="this.onclick()">Smileys</a>
</p>

<p>
<textarea name="comment" cols="50" rows="12">{comment}</textarea>
</p>

{if not_logged_in}
<p><input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information</p>
{/if}

<p><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</p>

{if captcha}
<p>Submit the word you see below:</p>
<p>
{captcha}
<br />
<input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
</p>
{/if}

<input type="submit" name="submit" value="Submit" class="submit-button" />
<input type="submit" name="preview" value="Preview" class="submit-button" />
{/exp:comment:form}
</div><!-- end comments -->

<p>



     </div><!-- end primarycontent-->
     <hr />

{embed="shopgolfincludes/secondary_sidebar"}

{embed="shopgolfincludes/footer"}

</body>
</html>
8
  • 1
    Can you, please, add the code of the exp:weblogs tag used on these pages? – Sobral Jun 19 '14 at 2:48
  • What 404 code do you have in place? – Michael Boyink Jun 19 '14 at 11:12
  • @RobsonSobral: I added the code as requested. – user3250 Jun 19 '14 at 13:13
  • @MichaelBoyink I am not sure about the 404 ... new territory for me there ... I've just been using a standard EE setup on Engine Hosting. There's no 404 specific line in my .htaccess – user3250 Jun 19 '14 at 13:16
  • 3
    404 situations need to be addressed on each template. Here's a good primer: joviawebstudio.com/index_ee.php/blog/… – Michael Boyink Jun 19 '14 at 13:46
3

The point is that sometimes you are limiting the weblog related to every template ( {exp:weblog:entries weblog="{master_weblog_name}" rdf="off"}), sometimes you aren't ({exp:weblog:entries limit="1" rdf="off" disable="pagination"}). Both your templates are loading entries from both weblogs.

Add the weblogs parameter to all exp:weblog:entries variables and on the first one add the require_entry parameter and a no_results conditional.

{exp:weblog:entries weblog="{master_weblog_name}" require_entry="yes" limit="1" rdf="off" disable="trackbacks|member_data|pagination|comments"}
    {if no_results}
        {redirect="404"}
    {/if}
[...]

Set which template to use for 404. Now, every time the exp:weblog:entries doesn't find an entry for the given weblog, the user will be redirected to the 404 template.

2
  • I changed the templates and cleared the caches from within the admin/utilities The wayward posts still appear. – user3250 Jun 20 '14 at 15:39
  • I'm sorry, but I can't figure how to help you without inspect your actual system. I'm sorry. – Sobral Jun 21 '14 at 4:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.