MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

URL Rewriting and Adding Custom subdomain   (Mono Support )

Viewed 88471 time(s), 12 post(s) 9/5/2011 7:49:29 AMby adisoft

Related topics

adisoft

adisoft

9/5/2011 7:49:53 AM
Hello
We have created a page to register company and after registration, company should be able to register users. default page of the company should have to open like
company.domain.com.
we are tried to use API's of IIS and web.config settings of Monox but we have to make this functionality dynamic. but we have Monox version that does not have source code. how is it possible to add functionality ?
thanks in advance.
This content has not been rated yet. 
35 Reputation 5 Total posts
khorvat

khorvat

9/5/2011 8:27:56 AM
Hi,

  as you mentioned that you have managed the IIS configuration but you need to configure MonoX, can you tell me what exactly do you need to configure in the MonoX, e.g. please describe the functionality you want to develop ?

Do you want the MonoX to know  which company user is looking by the domain or something else ?

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
adisoft

adisoft

9/5/2011 9:09:40 AM
Hi,

What we exactly want is that first we create a company profile through company registration and when a company joins this website they will get their own subdomain like company.domain.com.so if a client comes to www.domain.com and signs in (logs in) they get redirected to their company subdomain and they can see the logo etc of that company

But we have Monox version that does not have source code. how is it possible to add the above functionality ???

Regards,

This content has not been rated yet. 
35 Reputation 5 Total posts
khorvat

khorvat

9/5/2011 9:17:19 AM
Hi,

  you don't need source code to redirect the company users to another subdomain you just need to add some functionality to MonoX controls through the MonoX API.

I'll try to put together a small walk-through in a hour, so you can see what you need to tweak to get this done.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
imarusic

imarusic

9/5/2011 11:01:51 AM
Hi Adisoft,

in order to use your custom logic after users loggin and registration you need to extend MonoX loginModule and use an event from membershipEditor.

1. loginModule - create your own login module which extends the MonoX ones, override RedirectAfterLogin() method and add your custom logic.
2. membershipEditor - you can utilize AccountCreationCompleted event and add your custom logic.

3. To change the logo image you can replace link(MonoX default.master):

<a href='<%= MonoSoftware.Web.UrlFormatter.ResolveServerUrl(MonoSoftware.MonoX.Utilities.LocalizationUtility.
RewriteLink("/")) %>' class="logo"><
img runat="server" src="<%$ Code: MonoSoftware.MonoX.Paths.App_Themes.img.
logo_png %>" alt="MonoX" />
</
a>            

with your custom one.

4.To make some changes to footer section you can modify MonoX pageFooter user control, but loginName and loginStatus should be present in that control markup because they are used in code behind.
This content has not been rated yet. 
3016 Reputation 428 Total posts
adisoft

adisoft

9/5/2011 12:17:28 PM
Hello
Thanks for your replies.
We need that functionality that when ever a company is registered with Monox System, It will have it's own sub domain like, if we have to register a company named 'company1' and our website is www.sitename.domain. after registration company user will be able to create it's own users and it's path would be accessible by htt://company1.sitename.domain.

thanks in advance

This content has not been rated yet. 
35 Reputation 5 Total posts
khorvat

khorvat

9/5/2011 12:25:27 PM
Hi,

ok, great I hope that this will help you find a solution, If you need anything else let us know.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
adisoft

adisoft

9/5/2011 12:52:55 PM
Need help for the issue.
This content has not been rated yet. 
35 Reputation 5 Total posts
imarusic

imarusic

9/5/2011 1:10:26 PM
Hi,

you can uset below code snippet for redirecting after the loggin in:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
 
namespace YourNamespace
{
    public partial class LoginModule : MonoSoftware.MonoX.ModuleGallery.LoginModule
    {
        public override void RedirectAfterLogin()
        
                Response.Redirect("htt://company1.sitename.domain");        
        }
    }
}


you can find more information on how to extend MonoX module here.
This content has not been rated yet. 
3016 Reputation 428 Total posts
adisoft

adisoft

9/5/2011 1:32:35 PM
Hi imarusic,

Thanks for reply,you hv provided details about how to redirect after login.
<code style="color: blue;"></code>

But what i m asking is how i can create a subdomain like (htt://company1.sitename.domain) where company1 is a Company username in company registration.

Thanks in advance,

This content has not been rated yet. 
35 Reputation 5 Total posts
1 2