Mono Support URL Rewriting and Adding Custom subdomain  

98185 put(a) pogledan, 12 odgovor(a), 5.9.2011. 7:49:29 - Kreirao(la) adisoft
5.9.2011. 7:49:53
35 Reputacija 5 Ukupno objava

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.

1
5.9.2011. 8:27:56
15993 Reputacija 2214 Ukupno objava

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

2
5.9.2011. 9:09:40
35 Reputacija 5 Ukupno objava

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,

3
5.9.2011. 9:17:19
15993 Reputacija 2214 Ukupno objava

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

4
5.9.2011. 11:01:51
3016 Reputacija 428 Ukupno objava

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.

5
5.9.2011. 12:17:28
35 Reputacija 5 Ukupno objava

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

6
5.9.2011. 12:25:27
15993 Reputacija 2214 Ukupno objava

Hi,

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

Regards

7
5.9.2011. 12:52:55
35 Reputacija 5 Ukupno objava

Need help for the issue.

8
5.9.2011. 13:10:26
3016 Reputacija 428 Ukupno objava

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.

9
5.9.2011. 13:32:35
35 Reputacija 5 Ukupno objava

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,

10
1 2
Ovo je MonoX demo site. Posjetite Mono Software za više detalja.