Mono Support Group Page URL Rewrite  

Viewed 28938 time(s), 7 post(s), 1/22/2013 4:00:17 AM - by sam0864
1/22/2013 4:00:17 AM
656 Reputation 79 Total posts

I have few groups and created custom page for each group. For example, I have Web Design group. Using groups.aspx code, I customized it for Web Design group and named it as WebDesignGroup.aspx. I want to update the URL for this group to be (http://localhost/WebDesign)
I used this code
<rewrite url="^(.*)/Webdesign/(.*)?$" to="$1/MonoX/Pages/SocialNetworking/WebDesignGroup/GroupView/ogTE0Fmv1E6yrZ2lAYWbkg/Web-design/$2" name="WebDesign" defaultPage="/MonoX/Pages/SocialNetworking/WebDesignGroup/GroupView/ogTE0Fmv1E6yrZ2lAYWbkg/Webdesign/" urlPattern="/Webdesign/{PageName}" />

but the problem I lose the custom URL once the user navigate to the group discussion board and topics

I want to continue use and keep the same URL logic for any inherited links
for example the URL should look like - if possible -

http://localhost/WebDesign/
http://localhost/WebDesign/Discussion/***
http://localhost/WebDesign/Topics/****

I don't want to go back to URL like this one
http://localhost/MonoX/Pages/SocialNetworking/Groups/dboard/djwRhTGJa0y3rZ2lAYXIXw/Web-design/?GroupId=ogTE0Fmv1E6yrZ2lAYWbkg&iwm=DiscussionBoard
or
http://localhost/MonoX/Pages/SocialNetworking/Groups/dtopic/7ML63pf5W02M_qE4AZtvww/Testing-Web-Design-Group-Discussion-Board/?GroupId=ogTE0Fmv1E6yrZ2lAYWbkg&iwm=DiscussionBoard

Assuming I know the group ID



1
1/22/2013 7:30:35 AM
2793 Reputation 345 Total posts

maybe if you moved those pages to the top folder instead?

btw, apart from url rewrite on mozilla, chrome (not ie) one can use javascript history api I think to change address bar

2
1/22/2013 5:14:55 PM
656 Reputation 79 Total posts

Does it make a difference?

My issue is with updating Discussion boards/topics group internal URLs to be look like
http://localhost/WebDesign/Discussion/***
http://localhost/WebDesign/Topics/****

3
1/23/2013 8:43:35 PM
656 Reputation 79 Total posts

Any tips/suggestion??

4
1/24/2013 1:56:06 PM
1849 Reputation 181 Total posts

Our suggestion is to don't change the root of the Groups URL, because it is very complex functionality and if you change that you can provide a lot of problems. 

Can you tell us what you trying to do? Maybe we can help you with other suggestions.

5
1/25/2013 6:11:59 AM
656 Reputation 79 Total posts

Assume, I have three main groups (group1, group2, and group3). I created the three group and want to customize each group page. I customized groups.aspx code for each group and renamed to customgroup1.aspx, customgroup2.aspx,..

Since I know group ID of each group, I want to organize and simplify the URL to access each group
Something like
http://localhost/group1/
or
http://localhost/mygroups/group1

I was able to update the rewrite parameters to access the group with simple URL. I need help in updating the internal group links (such as photos, discussion boards, topics,..) and continue using the same URL pattern
for example
http://localhost/mygroups/group1/discussiion/*/*/*
and
http://localhost/mygroups/group1/topics/*/*/





6
1/25/2013 8:41:01 AM
15993 Reputation 2214 Total posts

Hi Sam.

Group WebPart is very complex control that uses by default three large sections (Wall notes, Discussion boards & Photo galleries), every section for it self has a few rewriting rules that are built to manage rewriting in stand alone scenario and in group scenario. In order to point everything to your main groups you will have to change the following rules:

<!-- social networking general -->
<rewrite url="^(.*)/RequestConfirmation/(.*)/(.*)/(\?(.+))?$" to="$1/MonoX/Pages/MonoX/Confirmation.aspx?RequestType=$2&RequestId=$3&$5" name="RequestConfirmation" urlPattern="/RequestConfirmation/{RequestType}/{RequestId}/" />
<!-- Photo Gallery -->     
<rewrite url="^(.*)/(.*)/activeview/(.*)/albumview/(.*)/(\?(.+))?$" to="$1/$2.aspx?AlbumId=$4&activeview=$3&$6" name="PhotoList" defaultPage="/MonoX/Pages/SocialNetworking/PhotoGallery.aspx" urlPattern="/{PageName}/{ActiveControlAction}/{ActiveControlValue}/{AlbumView}/{AlbumId}/" />
<rewrite url="^(.*)/(.*)/activeview/(.*)/photoview/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?FileId=$4&AlbumId=$5&activeview=$3&$7" name="PhotoView" defaultPage="/MonoX/Pages/SocialNetworking/PhotoGallery.aspx" urlPattern="/{PageName}/{ActiveControlAction}/{ActiveControlValue}/{PhotoView}/{PhotoId}/{AlbumId}/" />
  <!-- discussion board -->
  <rewrite url="^(.*)/(.*)/dboard/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?boardId=$3&$6" name="Discussion" defaultPage="/MonoX/Pages/SocialNetworking/Discussion.aspx" urlPattern="/{PageName}/dboard/{BoardId}/{Slug}/" />
  <rewrite url="^(.*)/(.*)/dtopic/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?topicId=$3&$6" name="DiscussionTopic" defaultPage="/MonoX/Pages/SocialNetworking/Discussion.aspx" urlPattern="/{PageName}/dtopic/{TopicId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/dfilter/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?tftype=$3&$6" name="DiscussionTopicFilter" defaultPage="/MonoX/Pages/SocialNetworking/Discussion.aspx" urlPattern="/{PageName}/dfilter/{FilterType}/{Slug}/" />
<rewrite url="^(.*)/(.*)/dfilter-tag/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?tftype=$3&dbtTag=$4&$6" name="DiscussionTopicTagFilter" defaultPage="/MonoX/Pages/SocialNetworking/Discussion.aspx" urlPattern="/{PageName}/dfilter-tag/{FilterType}/{Slug}/" />
  <rewrite url="^(.*)/(.*)/dmessage/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?dmsgId=$3&dmsgMode=$4&$6" name="DiscussionEditMessage" defaultPage="/MonoX/Pages/SocialNetworking/Discussion.aspx" urlPattern="/{PageName}/dmessage/{MessageId}/{Mode}/" />
and maybe these, if you want to enable direct group editing on your main groups:

<!-- dynamic group rules, can be used regardeless of the actual name of the page that holds group parts -->
<rewrite url="^(.*)/(.*)/GroupView/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?GroupId=$3&$6" name="GroupView" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupView/{ShortId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/GroupEdit/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?GroupId=$3&EditMode=true&$6" name="GroupEdit" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupEdit/{ShortId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/GroupList/(\?(.+))?$" to="$1/$2.aspx$3" name="GroupList" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupList/" />
<rewrite url="^(.*)/(.*)/GroupInsert/(\?(.+))?$" to="$1/$2.aspx?InsertMode=true&$4" name="GroupInsert" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupInsert/"/>
<rewrite url="^(.*)/(.*)/GroupSearch/(.*)/(\?(.+))?$" to="$1/$2.aspx?SearchValue=$3&$5" name="GroupSearch" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupSearch/{SearchValue}/" />
<rewrite url="^(.*)/(.*)/GroupSearch/(\?(.+))?$" to="$1/$2.aspx?ShowAllGroups=true&$4" name="GroupSearchShowAll" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupSearch/" />
<rewrite url="^(.*)/(.*)/GroupCategory/(.*)/(\?(.+))?$" to="$1/$2.aspx?Category=$3&$5" name="GroupCategory" defaultPage="/MonoX/Pages/SocialNetworking/Groups.aspx" urlPattern="/{PageName}/GroupCategory/{CategorySlug}/" />
NOTE: If you change these rules to point to your main groups you will lose the rewriting functionality for other groups and those WebPart in stand alone usage. 

I'd suggest you to another approach as this one will require a lot of effort and you will lose some functionality, why don't you go with changing the group rewriting to point to some "static page" and then on that page you handle the custom styling and WebPart for that specific group ?

Regards

7
This is a demo site for MonoX. Please visit Mono Software for more info.