Blog de Humpty

Express your heart's desire

Recent Posts

Tags

Email Notifications

People

Cool Sites

Archives

Community Server subdomain module

I like using Community Server as the software that powers my blog but I also dislike the all-inclusive nature of it.  Namely, that all the pieces of it are inter-twined: I don't want my blog to be tied into the rest of the community.  A lot of people who want what I do do so by way of various hacks, namely copying all the files under the blogs directory to the root and changing various config files.  The problem with this is that your community is now somewhat hardwired to point to your blog or whatever and you can't use the rest of the installation as is, should you want to.

I decided to create a subdomain module to get around this.  Now I can have my cake and eat it too!  This blog and the forums on my site both use the same instance of Community Server but you'll notice that they use two different urls and actually go to two different parts of it.  I decided to use my "real" site to post the details about how I did this and the download for the code, as well as the compiled dll module.  Now that I actually have my forums up you can use that or this blog post to talk about it.

TimothyHumphrey.CommunityServer

Posted: Tue, Mar 28 2006 2:20 AM by Humpty | with 13 comment(s)
Filed under: ,

Comments

JT Thompson said:

Hello,

I wanted to tell you that I'm extremely excited about this mod. I've been asking and almost begging for someone to do this. I have a client (i own a hosting company) that wants this option and I'm not able to give it to them. I'm going to try this tonight and see how it works but this is perfect.
# April 3, 2006 12:33 PM

Humpty said:

Wow, my first customer!  I hope it works well for you, if there's anything I can do to improve it just let me know.
# April 10, 2006 4:38 PM

Jaxon Rice said:

Timothy, this is really nice stuff, and exactly what I needed for a client's project. Thanks so much
# May 31, 2006 3:58 AM

Humpty said:

Wow, I missed your comment.  I'm really glad you like it!
# June 1, 2006 10:48 PM

Amir said:

Timothy I follow all instruction exactly. at localhost it works and redirect url like localhost/cs/myblog.timothyhumphrey.name/default.aspx to localhost/cs/blog/localhost/cs/myblog/default.aspx. But at DNS it does not work. It does not detect myblog.timothyhumphrey.name and show message:the page cannot be display
plz help me
# September 11, 2006 1:22 AM

Humpty said:

This would probably be a better question for my forums, forums.timothyhumphrey.name.  But no matter.

I'm guessing your problem is due to DNS issues, but not related to the SubdomainModule.  You have to make sure that whatever subdomain you're trying to use has been setup to serve content from Community Server otherwise the SubdomainModule will never receive the request.  So make sure the subdomain is valid and secondly confirm that it points to your Community Server installation.
# September 11, 2006 5:27 AM

Amir Abtahi said:

Thank you very mutch Timothy
your comment like an spark cause to solving the problem...I added a host like this *.cs.name to DNS that redirect all subdomain to cs.name and then your wonderful DLL works and redirect it.
# September 11, 2006 10:13 PM

Humpty said:

You're welcome, glad you were able to get everything working.  I think I'll add a note about this DNS issue on my site.
# September 12, 2006 5:28 AM

Harry said:

My ultimate goal is to let user type http://foobar.baz.com to access http://www.baz.com/blogs/foobar, and I understand that the subdomain redirection add-on does exactly that. However, I am having some trouble trying to test this out on my local server. I apologize for my stupidity here, but is it possible to try making http://foobar.localhost/csweb redirect to http://localhost/csweb/blogs/foobar? If so, how should I set up my subdomain node in SiteUrls.config?
# October 9, 2006 2:27 AM

Humpty said:

Whatever subdomain people will be using to access your site should point to your CS installation home.  So in your case first ensure that your DNS is setup to know that foobar.localhost is a valid domain and furthermore that foobar.localhost/csweb points to the same location as localhost/csweb, which I'm assuming is where your CS installation is.  After that you would use the following <subdomain> entry to redirect users.

<subdomain domain="(.*)\.localhost/csweb" path="$weblogs/$1" isPattern="true" />

The isPattern attribute marks the <subdomain> entry as a regular expression entry, the domain attribute is the search pattern and the path attribute is the replacement pattern.  In case anyone is reading this and doesn't understand regular expressions, what's basically happening is that the text before ".localhost" is being saved in the domain attribute, via the parenthesis, to be used later in the path attribute via the "$1".  Note, I used a patterned entry above because I assumed your ultimate goal was to let anyone on the third level of your domain go to a specific blog, if you specifically wanted the foobar domain only to be redirected you'd use this, even though the above would work too

<subdomain domain="foobar.localhost/csweb" path="$weblogs/foobar" />

The difference with this entry is that if you had other third level domains, or second level in this example, that should point to CS then they won't be redirected to a blog.

Please note though that the SubdomainModule does not actually perform a client side redirection.  So if a person enters foobar.localhost/csweb in the browser they will not be sent a 304 HTTP code to redirect them to localhost/csweb/blogs/foobar, instead the content that would appear at that url will instead appear at foobar.localhost/csweb.

# October 9, 2006 5:46 AM

CSfans said:

does Subdomain Module support Community Server 2007 ?

# May 4, 2007 10:03 AM

Robbie Coleman said:

I too was wondering if you were going to give this another go for the 2007 version of CommunityServer.

Afterall, you won't be able to upgrade your site to it until that's done anyway right...?

;-}

Well, either way, it is a sweet module and I hope you are doing well.

Thanks,

-- robbie

# August 27, 2007 8:55 PM

Michael Silva said:

I am also curious about whether this will work with CS 2007.  I am very excited about it from what everyone has posted.  

Are you working on a new version for CS 2007.

Thanks a bunch,

Michael

# February 28, 2008 4:30 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Enter the numbers you see in the image: