Monday, June 18 2007 on other
When I updated this site to CS2007, some of the pages broke. The two problems came up due to older configurations of this site. First, in a very old config, I had my RSS feed at /RSS/default.aspx. The other problem came about because I used to have the blog page at the root and now I have gone back to the default way of doing things. So let me show you how I solved both issues.
First the part about redirecting RSS/default.aspx. Actually this has nothing to do with Community Server. I simply went to my hosting provider's control panel site and created a virtual directory that pointed to the RSS feed, which is now hosted at Feedburner.
OK, that was easy. Redirecting the requests to blog pages at the root to now go to /blogs/technovangelist was a bit tougher. There were actually two main problems here: How do I redirect rss.aspx in the root of the site, and how do I redirect all of the calls to the archive blog postings that were under /archive to /blogs/technovangelist/archive.
The first of those two happened to be fairly easy. I simply created an rss.aspx page in the root with the following content:
<script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.StatusCode = 301; Response.Status = "301 Moved Permanently"; Response.RedirectLocation="http://feeds.feedburner.com/Technovangelist"; Response.End(); } </script>
Actually, it was a bit simpler than that. The actual process was search the net to find Hansleman's entry on solving the problem.
To solve the problem with the archive pages I got to take advantage of the new SiteUrls_Override.config file. Here is my config file with some of the non relevant lines removed:
<?xml version="1.0" encoding="utf-8" ?> <Overrides> <Override xpath="/SiteUrls/locations" mode="add"> <location name="OldBlogPathRedirect" themeDir="blogs" path="/"
type="CommunityServer.Blogs.Components.BlogLocation, CommunityServer.Blogs" > <url name = "Oldweblogday"
path="/blogs/technovangelist/archive/{1}/{2}/{3}.aspx"
pattern="archive/(\d{4})/(\d{1,2})/(\d{1,2})\.aspx"
physicalPath="##blogthemeDir##"
vanity="{2}?App=${{app}}&y=$1&m=$2&d=$3" page="postlist.aspx" /> <url name = "Oldweblogmonth"
path="/blogs/technovangelist/archive/{1}/{2}.aspx"
pattern="archive/(\d{4})/(\d{1,2})\.aspx"
physicalPath="##blogthemeDir##"
vanity="{2}?App=${{app}}&y=$1&m=$2&d=1" page="postlist.aspx" /> <url name = "OldweblogpostId"
path="/blogs/technovangelist/archive/{1}/{2}/{3}/{4}.aspx"
pattern="archive/(\d{4})/(\d{1,2})/(\d{1,2})/(\d+)\.aspx"
physicalPath="##blogthemeDir##"
vanity="{2}?App=${{app}}&y=$1&m=$2&d=$3&PostID=$4"
page="post.aspx" /> <url name = "OldweblogpostName"
path="/blogs/technovangelist/archive/{1}/{2}/{3}/{4}.aspx"
pattern="archive/(\d{4})/(\d{1,2})/(\d{1,2})/([a-zA-Z0-9\-\._]*?)\.aspx"
physicalPath="##blogthemeDir##"
vanity="{2}?App=Technovangelist&y=$1&m=$2&d=$3&PostName=$4"
page="post.aspx" /> <url name = "Oldweblogpostcategory"
path="/blogs/technovangelist/archive/category/{1}.aspx"
pattern="archive/category/(\d+)\.aspx"
physicalPath="##blogthemeDir##"
vanity="{2}?App=${{app}}&CT=BlogPost&CategoryID=$1"
page="postlist.aspx" /> <url name = "Oldweblogarticlecategory"
path="/blogs/technovangelist/articles/category/{1}.aspx"
pattern="articles/category/(\d+)\.aspx"
physicalPath="##blogthemeDir##"
vanity="{2}?App=${{app}}&CT=BlogArticle&CategoryID=$1"
page="postlist.aspx" /> </location> </Override> </Overrides>
As you you may be able to see, I just copied the lines from the SiteUrls.config file, then modified a few of the values. I am sure there is a more elegant way to do it, but this worked. If you know of a better way to handle this, please let me know.
Actually with the way it is now set up both of the following urls work:
technovangelist.com/.../how-to-redirecting-in-community-server-2007.aspx
and
technovangelist.com/.../how-to-redirecting-in-community-server-2007.aspx
Ahhh, so you're getting rid of the /blogs/technovangelist, not the archives. Thanks for straightening me out.
um, well, no. I am not getting rid of anything. I am only adding. to get to any post, you go to technovangelist.com/blogs/technovangelist/[rest of url] or technovangelist.com/[rest of url]. so that way the standard url works as well as the recommended way to set up a single blog at the root. Since this used to be the single blog at the root, there are still plenty of links to pages at the root. When I switched back, those links were breaking. This fixed that.
Dave Burke said on 6.18.2007 at 1:35 PM
Good stuff, TechnoV! Just to be clear, you're getting rid of the "archive" right? or from under /archive to /blogs/technovangelist/? Thanks!