diff --git a/Teknik/App_Start/SubdomainRoute.cs b/Teknik/App_Start/SubdomainRoute.cs index 348248d..75bc00c 100644 --- a/Teknik/App_Start/SubdomainRoute.cs +++ b/Teknik/App_Start/SubdomainRoute.cs @@ -81,6 +81,7 @@ namespace Teknik // Check if this route is valid for the current subdomain ('*' means any subdomain is valid) if (Subdomains.Contains("*") || Subdomains.Contains(subdomain)) { + routeData.Values["sub"] = subdomain; return routeData; } } diff --git a/Teknik/Areas/API/Controllers/APIv1Controller.cs b/Teknik/Areas/API/Controllers/APIv1Controller.cs index d1df9d5..1c62117 100644 --- a/Teknik/Areas/API/Controllers/APIv1Controller.cs +++ b/Teknik/Areas/API/Controllers/APIv1Controller.cs @@ -162,7 +162,7 @@ namespace Teknik.Areas.API.Controllers db.ShortenedUrls.Add(newUrl); db.SaveChanges(); - string shortUrl = Url.SubRouteUrl(string.Empty, "Shortener.View", new { url = newUrl.ShortUrl }); + string shortUrl = string.Format("http://{0}/{1}", Config.ShortenerConfig.ShortenerHost, newUrl.ShortUrl); if (Config.DevEnvironment) { shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = newUrl.ShortUrl }); diff --git a/Teknik/Areas/Shortener/Controllers/ShortenerController.cs b/Teknik/Areas/Shortener/Controllers/ShortenerController.cs index 108d6b9..e458fd0 100644 --- a/Teknik/Areas/Shortener/Controllers/ShortenerController.cs +++ b/Teknik/Areas/Shortener/Controllers/ShortenerController.cs @@ -56,7 +56,7 @@ namespace Teknik.Areas.Shortener.Controllers db.ShortenedUrls.Add(newUrl); db.SaveChanges(); - string shortUrl = Url.SubRouteUrl(string.Empty, "Shortener.View", new { url = newUrl.ShortUrl }); + string shortUrl = string.Format("http://{0}/{1}", Config.ShortenerConfig.ShortenerHost, newUrl.ShortUrl); if (Config.DevEnvironment) { shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = newUrl.ShortUrl });