How do I change the link URL for the main homepage link appearing in the top-left corner of the BE2.0 default template?

Topics: Controls
Feb 16, 2011 at 6:01 AM

Does anyone know how to change the link appearing in the top-left corner of the BlogEngine 2.0 default template that typically points to the blog's homepage?

I set up my first BlogEngine.net blog at a subdomain of my mother's website: blog.pamelaegan.com.  On the main index page (blog.pamelaegan.com), the main link to the homepage appearing in the top-left corner of every page of the site displays the proper URL.  However, on all post-level, tag and category pages, the URL to which the main homepage link is pointed includes the subdirectory (blog.pamelaegan.com/blog).

How do I change either one or the other?

Granted, they both resolve to the blog's homepage, however, the duplicate homepage URL's are causing me to lose valuable linkjuice that I'd much rather have counting towards my site and not creating duplicate page/content/url problems for the search engines.  Most of my external links point to my blog's homepage without the subdirectory in the URL, so if possible I'd rather get all my internal top-left homepage links pointing to the (blog.rootdomain.com) URL without the extra /blog/ subdirectory after the .com.  However, if it is only possible to change the main homepage link to itself and not the same link on all other pages, I would still like to do this so that at least the URLs in my links are consistent.

Any input would be greatly appreciated.

Feb 16, 2011 at 6:51 AM

Probably a better way to do this, but you could go into /themes/standard/site.master and change the following lines:

    <ul>
      <li><a href="<%=Utils.AbsoluteWebRoot %>" rel="home"><%=Resources.labels.home %></a></li>
      <li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
      <li><a href="<%=Utils.AbsoluteWebRoot %>contact.aspx"><%=Resources.labels.contact %></a></li>
      <li><a href="<%=Utils.FeedUrl %>" class="feed"><img src="<%=Utils.AbsoluteWebRoot %>pics/rssButton.png" alt="Feed" /><%=Resources.labels.subscribe %></a></li>
      <li><a href="javascript:void(BlogEngine.filterByAPML())" class="apmlfilter"><%=Resources.labels.filterByApml %></a></li>
    </ul>

Change the 2nd line above to the following:

    <ul>
      <li><a href="/" rel="home"><%=Resources.labels.home %></a></li>
      <li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
      <li><a href="<%=Utils.AbsoluteWebRoot %>contact.aspx"><%=Resources.labels.contact %></a></li>
      <li><a href="<%=Utils.FeedUrl %>" class="feed"><img src="<%=Utils.AbsoluteWebRoot %>pics/rssButton.png" alt="Feed" /><%=Resources.labels.subscribe %></a></li>
      <li><a href="javascript:void(BlogEngine.filterByAPML())" class="apmlfilter"><%=Resources.labels.filterByApml %></a></li>
    </ul>
That'll change the 'home' link so that it's always pointing to the top level of your website. Like i said though, there's might be a better way to do it.  Could also maybe try changing Utils.AbsoluteWebRoot to Utils.RelativeWebRoot

Feb 16, 2011 at 8:26 AM

Many thanks for taking the time to reply.  Forgive me if this seems like an extremely stupid question, but in order to do as you've suggested, I would have to use FTP to manually go into my server, find the directory you specify, find the correct file, open it, and then manually make the changes to the code outlined in your comment above?

I'm sorry, but I'm relatively new to this, especially .net software and Windows servers.  Wordpress is about as complex as I've dealt with before.

I sincerely appreciate you taking the time to help me out.  This stuff does not come naturally to me, and I greatly appreciate you taking the time to point me in the right direction.

Feb 16, 2011 at 8:38 AM

Yes, that's right. If you have ftp access to your hosting account, then yes, open your ftp program, navigate to that folder/file and you can edit it with any text editor. 

If you want to try and get a little fancier, you can download visual studio web 2010, which is a free product from microsoft. It's an editor specifically for aspx and .net files. For this type of change though, especially for someone who's new to this, it's probably best to just stick with whatever text editor you want to use. Just make sure you save the file as plain text, and not as a word file or anything like that.