Manage Multiple websites on a single domain

Kiran Chavada asked on November 14, 2016 11:03

Hello Team, Hope you are fine.

please find questions are as below :

  1. How could multiple developers can work on Kentico website, and what kind of security it provides which will secure the code from data loss while there are more than one resource working on the same page.

  2. How to manage deployment for Staging sever and Production server, as currently on development server and staging server we are working on Free edition license key, and the feature is denied for us because of what we are unable to use this feature, if there is something which can resolve this issue for us then please let us know.

  3. How to manage Multiple websites on a single domain, please review my requirement below: To develop one installation of Kentico to run three separate sites. The sites should use users current Geo Location and redirect the user on relevant domain. Like: We have one of our global website URL, and other are specific to the Geo locations only 1) www.example.com 2) www.example.com/uk 3) www.example.com/au

If user belong from UK and open www.example.com then we want to redirect the user on www.example.com/uk, and the same way for Australia as well; if the user is from any other location than we would like to keep the user on the site only and load the website as it.

Thanks.

Recent Answers


David te Kloese answered on November 14, 2016 13:32

Hi,

Why are you using a free edition for dev and staging? Is your production version also the free edition? If not you could get (free) development versions of your license from the client portal or contact Kentico.

1. you could take a look at object locking: Devnet: Working with object locking. Make sure to check the cache settings.

If your license allows it have a look at Continuous Integration.

2. Not sure if allowed in your version, but I guess you could always use Import/Export.

3. Depending on what you want you might want to have a look at MaxMind's GeoIP databases (free version included in Kentico).

0 votesVote for this answer Mark as a Correct answer

Suneel Jhangiani answered on November 14, 2016 22:56

I posted the following Macro code in the T-Shirt contest, and it should provide you the basics for getting the Visitor's Country so that you can redirect them. This uses the MaxMind GeoIP Databse that ships with Kentico and is part of WebAnalytics and hence you may need a license that supports that.

[MacroMethod(typeof (bool), "Checks if the current visitors IP Address is in blocked countries", 1)]
public static object IsVisitorInBlockedCountry(EvaluationContext context, params object[] parameters)
{
    if (parameters.Length != 0)
        throw new NotSupportedException();

    string userIP = RequestContext.UserHostAddress;
    int countryId = GeoIPHelper.GetCountryIDByIp(userIP);

    if (countryId == 0)
    {
        // check if it's the localhost so that it skips logging
        if (userIP != "::1")
        {

            string countryCode = "";

            // we couldn't resolve the country, so let's add a log entry
            var location = GeoIPHelper.GetLocationByIp(userIP);
            if (location != null)
                countryCode = location.CountryCode;

            string evDescription = "Unable to determine country for visitor." +
                                   "" +
                                   $"IP Address: {userIP}" +
                                   $"Country Code: {countryCode}";

            // we do have a countryName so let's log this.
            EventLogProvider.LogEvent(EventType.WARNING, "Blocked Country", $"LOOKUP - {countryCode}", evDescription);
        }

        // note: hard-coded default value (should use the settings app instead) 
        return false;
        // return CustomEcommerceSettings.UnknownCountryIsBlocked(new SiteInfoIdentifier(SiteContext.CurrentSiteID));

    }


    // We use a custom class to store the blocked countries
    return BlockedCountryInfoProvider.IsCountryBlocked(countryId, SiteContext.CurrentSiteID);
}
0 votesVote for this answer Mark as a Correct answer

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