Different CMS URL

Yowaraj Chhetri asked on July 6, 2018 05:23

Hi, I have a domain name as abc.edu.in and I want to access my CMS admin interface via cms.abc.edu.in/admin and not by abc.edu.au/admin. How to do that, keeping in mind that if site users enter abc.edu.in/admin, it must redirect to abc.edu.in

Thanks in advance

Correct Answer

vasu yerramsetti answered on July 6, 2018 11:16

@Yowaraj,

Please follow below steps:

  1. Add license for cms.abc.edu.in domain
  2. Add cms.abc.edu.in as domain alias for abc.edu.au (Edit site: Site-> Edit site --> select Domain Alias tab--> Add cms.abc.edu.in domain )
  3. Write Redirect Rule in web.config file to redirect from abc.edu.au/admin to cms.abc.edu.in/admin

I hope this will help you.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Yowaraj Chhetri answered on July 11, 2018 07:13

Hi Vasu, Is it fine to redirect using module class as below instead of creating redirect rule in webconfig file.

[assembly: RegisterModule(typeof(URLModule))] namespace Modules { public class URLModule : Module { public URLModule() : base("URLModule") { } protected override void OnInit() { base.OnInit();
URLRewritingEvents.ProcessRewritingResult.After += ProcessRewritingResult_After; }

    private void ProcessRewritingResult_After(object sender, URLRewritingEventArgs e)
    {
        if (e.Parameters.ViewMode == CMS.PortalEngine.ViewModeEnum.LiveSite)
        {
            var currentUrl = CMSHttpContext.Current.Request.Url;
            if (currentUrl != null && ((currentUrl.ToString().Contains("logon.aspx")) || (currentUrl.ToString().Contains("/admin") || (currentUrl.ToString().Contains("/admin/")))))
            {
                if (currentUrl.ToString().Contains("cms") || currentUrl.ToString().Contains("cms.abc"))
                {
                }
                else
                {                      
                    var context = CMSHttpContext.Current;
                    context.RewritePath("/");
                    e.Parameters.Status = RequestStatusEnum.PathRewritten;
                }
            }
        }
    }
}

}

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.