MVC :: How To Subdomain In Asp.net
Mar 15, 2011
i'm new to asp.net mvc2. i'm developed one project using asp.net mvc2 and vs2010 using linq to sql server. my project like a blog posting comment,
create tickets. my problem is when user register in my blog example my blog name is "helpdesk.com". when user register in my blog with the company name example "something". after registering the user i want to create one sub domain for this user like "something.helpdesk.com"
using this url "something.helpdesk.com" how to server my view pages. i'm not getting any idea. in this concept i have no idea about routing concepts. any body know please suggest me how to create sub domain and how can i server the view pages with in subdomain.
View 1 Replies
Similar Messages:
Nov 15, 2010
What I want to do is take traffic that is going to shop.mywebsite.com and redirect or rewrite (I'm not sure of the terminology) the domain to be www.mywebsite.com/shop. Both shop.* and www.* are separate web applications (nopCommerce and Umbraco respectively) that don't seem to cooperate when I've tried to nest them. Both applications are in a Server 2008 R2/IIS 7.5 environment.
I've searched around stackoverflow and what I've found is a lot of answers to mapping the other direction (ie subfolder to a subdomain) but that's not what I'm looking for as far as I understand the problem.
The end goal is to combine the SEO reputation of the shop subdomain into the www subdomain. I readily admit that I might have this all backwards and am willing to try any suggestions I'm offered.
View 1 Replies
Jan 31, 2010
I have an app with multiple subdomains, subone.parent.com, subtwo.parent.com.
I have a logon page at parent.com/login. When a user logs in I redirect them to the proper domain based on which one they are a member of. This works fine.
FormsAuthenticationTicket ticket = new FormsAuth...
string encTicket = FormsAuthentication.Encrypt(ticket);
var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
cookie.Domain = subone.parent.com
Repsonse.Cookies.Add(cookie)
This properly authenticates the user for subone.parent.com and not subtwo.parent.com. However I would like to do the following.
If the user goes back to parent.com, I would like to know that they are logged in and redirect them back to subone.parent.com.
Is there a best practice for accomplishing this? Or do I have to set another cookie for parent.com?
I'm working in asp.net mvc if it matters.
View 3 Replies
Nov 26, 2010
I'm using a BlogEngine.net for my blog and I would like to create 5 different subdomains and point to different subfolders(not redirecting). For example:
firstsubdomain.domain.com - domain.com/posts/helloworld.aspx
firstsubdomain2.domain.com - domain.com/posts/helloworld2.aspx
firstsubdomain3.domain.com - domain.com/posts/helloworld3.aspx
I'm using asp.net 3.5, C#, Windows Server 2008, IIS 7
View 1 Replies
Jun 15, 2010
Is it possible to create a subdomain using asp.net? Or is it possible to use url rewrite on IIS to create/cloak a subdomain.
Rewrite this page to http://www.mydomain.com/myprofilename into http://www.myprofilename.mydomain.com
View 6 Replies
Feb 27, 2011
I have made an asp.net mvc 3 application with an area called blog. I want to route this area to my subdomain blog.mywebsite.com. How can I achieve this?
How do I need to define my route? Do I have to configure the DNS?
Currently I just use the default area route. I can access my blog area for now at this way.
mywebsite.com/blog
View 1 Replies
May 7, 2010
I am using MVC 2.0 to create my application,my problem i s related to the routing. Actually in my application each user have required seperate subdomain,like
www.example.com/user1/ ,www.example.com/user2/ ...etc.the default domain is www.example.com.So how can i make it possible with routing in mvc.
i have tried like this,
routes.Add(new Route("{id}", new RouteValueDictionary(new { controller = "User", action = "login", id = " " }), new MvcRouteHandler()));
var defaults = new RouteValueDictionary(
new
{
controller = "Home",
action = "Index",
id = UrlParameter.Optional
}
);
routes.Add(new Route("{controller}/{action}/{id}", defaults, new MvcRouteHandler()));
But the problem is that it take deafult (www.example.com) directly to user login page.I want the default page as Home/index and when www.example.com/user1/ it will go to user login page.
View 1 Replies
Jun 15, 2010
I want to have a subdoman (sub.site.net).irst of all, I don't know how to copy my files to this registered subdomain. Second: I want to Redirect my whole website to a new sudomain. for example if a user types: "www.site.net" it automatically goes to "sub.site.net". is it possible? if yes, What should I change? Maybe in my master page?
View 4 Replies
Nov 7, 2010
I want to wipe a subdomain off the face of the internet.
So any page in the sitemap I want it to 301 redirect over to the homepage of the main www site...
Can that be done? I tried setting the re-direct in IIS, but it only worked if I hit the homepage (the subpages all 404d)
View 1 Replies
Dec 31, 2010
How to create sub Domain in asp.net. am created some pages in sample folder i need to create sub domain like sample.mydomain.com
how to integrate codings.
View 8 Replies
Jul 2, 2010
I got a website [URL] and I want to redirect http://www.example.com/folder to http://folder.example.com so if
folder has a page called example1.aspx [URL]
It should be called in this way:
http://folder.example.com/example1.aspx Is that possible that using IIS 7 and asp.net 4.
View 2 Replies
May 12, 2010
I am creating a social networking site and one of the requirements is to have the subdomain like URL for each user. For example, for the user1 his profile page will be user1.mysitename.com and for the user2 profile page will be user2.mysitename.com.
Can it be done using url aliasing? basically user1.mysitename.com should be www.mysitename.com/profile.aspx?username=user1
I will be hosting this in windows 2003 (IIS6),
View 1 Replies
Feb 9, 2011
I have an asp.net website. I want to add subdomain for a secondary language:
[URL]= main
[URL]= chinese
I have no idea where to start.
View 1 Replies
Jan 20, 2011
I added the following entries in the HOSTS file.
127.0.0.1 abc.localhost.com
127.0.0.1 xyz.localhost.com
Using the VS2010 ASP.NET Development server I am unable to run or execute the website.
When browsing http://localhost:2687/TestProject/ it shows up the default.aspx page. But when accessing http://abc.localhost:2687/TestProject/ it shows a website cannot be found page.
Is there anything else to be done when setting up subdomain on localhost.
EDIT: To make this work I removed the .com and in IE-->Connections-->LAN uncheck everything. Subdomains with port works are correctly getting forwarded. Nothing else need to be configured.
View 2 Replies
Oct 28, 2010
While writing an asp.net project i may have this url for testing/debugging
http://localhost:1234/
I have code that takes in account of subdomains. Can i make visual studios call the same code with
http://anysub.localhost:1234/
View 1 Replies
May 3, 2010
I have a portal say 'portal.mysite.com'. I have another portal say 'login.mysite.com'. Could someone tell me how I could use the same login credentials to login into the subdomain?
View 1 Replies
Feb 2, 2011
i have website [URL] this website got capability of host multiple shop sites with in... Now issue i am facing is that when we create sub site like this [URL] its working on production server. where as the code version i am running on windows 7.
I have stuck in a situation the error is occuring on subdomain site...
to reproduce that on my local machine... don't no what to do..
View 2 Replies
Aug 17, 2010
Just curious if subdomains can be generated dynamically. For example say I have [URL]. In a SQL DB is a list of cities. Can these be used to generate new subdomain for each city? (ie [URL], [URL], etc.) Or do I have to create every sub domain I want manually?
View 4 Replies
Sep 29, 2010
how can i redirect to another url when SubDomain does not exist?
like:
NotExist.MyDomain.com -> www.MyDomain.com/NotExist
I'm running on:
Windows 2003 Server
Plesk Control Panell 9.5
.Net Framework 4.0
And No Access IIS
View 2 Replies
Feb 3, 2010
i have on website with name theweddingstore.ie now i have done url rewritting for this website but now we want to make "http://www.theweddingstore.ie/prakash" to "http://www.prakash.theweddingstore.ie".I can't start how to make it and i am totally confuse any anyone guide me and i have dedicate server.
View 1 Replies
Mar 18, 2011
I'm using ASP.NET 4 WebForms, and can't find information about creating wildcard subdomains.
For example, url user22.example.com must point to example.com/users/user22.
May i implement this feature only with Routing (without IIS url-rewrite, or another external tools)?
View 3 Replies
Jan 4, 2011
I wants to url rewriting like as subdomain.
For example my website is website.com so that now i wants to url rewriting like
client1.website.com ,
client2.website.com,
client3.website.com,
clientN.website.com
In my website there are list of client whenever click on client my url like this
website.com/client.aspx?client=client1
website.com/client.aspx?client=client2
website.com/client.aspx?client=client3
website.com/client.aspx?client=clientN
Now i wants to url rewriting like as
client1.website.com
client2.website.com
client3.website.com
clientN.website.com
Also whenever once client is registered,After that client can directly open site
View 1 Replies
Jun 16, 2010
I have created my url rewrite handler and its working fine, but on live site i have IIS 6
and its not accepting the subdomain requests
when i type
http://website.com
it works fine but with
http://sub.wesite.com
i got the error Server not found
View 2 Replies
Mar 16, 2010
i have two different websites. the first one is the main website of a company and it is at www.company.com
the second one is an online shop of that company and it is located at www.e-order.company.com
at the App_Data directory of the second page there is an access database that i want to have access also from the first site.
the connection string i use at the second site is:
[Code]....
what should it be the connection string for the first one?
the purpose of this is to login from the main site and then been redirected to the e-order site
View 6 Replies
Feb 8, 2011
I've created a new Route class, named SubdomainToAreaRoute, inherited from System.Web.Routing.Route, to handle subdomain.
The next implementation needed is to create a helper method to generate subdomain link.
For example:
Html.ActionLink("subdomain1", "account", "index") would generate:
http://subdomain1.example.com/account/index A series of other overloaded methods will also be implemented.
I undestand the geist of creating extension methods, which is one of the requirement to implementing these helper methods. Thus the main concern here is knowing what objects/classes to access and manipulate, and recommended algorithm to use.
There are some things that is unclear to me. For example, we register routes in the RouteTable.Routes (or simply route table), and whenever a url is requested, the url request is checked in the route table. If no url pattern matches, or if there is a matching pattern and the resource (e.g. web page) is missing, we receive a http error.
What is unclear here is in cases where specific physical path to a resource, like an image or javascript file is used for request. If these physical path url do not match the url patterns in the route table, how does an MVC application know to check for web application directory for the resource as the next step? As oppose to throwing an http error saying the resource can not be found.
This question may or may not affect my main concern here. But it is good to know if someone can explain it.
Focusing on registered routes, consider the following url route registration:
routes.Add("Home", new SubdomainToArea("", new { area = "Root", controller = "Home", action = "Index" } ) );
// route pattern 1
// intended to map to url: http://{area}.localhost.com
routes.Add("Default", new SubdomainToArea("{controller}/{action}", new { area = "Root", controller = "Home", action = "Index" } ) );
// route pattern 2
// intended to map to url: http://{area}.localhost.com/{controller}/{action}
routes.Add("Images", new SubdomainToArea("images/{*pathInfo}", new { area = "Root", controller = "Home", action = "Index" } ) );
// route pattern 3
// intended to map to url: http://{area}.localhost.com/images/{random path string}
How do I create helper methods to generate the appropriate url that matches these patterns?
I understand that extension methods for the UrlHelper class should be implemented to generate these url, and these url will be use in HtmlHelper class to generate the appropriate link tags.
In these helper methods, e.g. in the UrlHelper class, if passed a set of route values (such as controllers, action, areas and other url path details), how do we choose the appropriate route pattern that is registered in the route table, and then apply the route values to the pattern to generate the url?
How should I handle in cases where I don't specify one? What does the standard Html- Url- helper methods handle in case where no route name is not specified?
I understand the placeholder {controller}, {action} and {area} have special meaning and can be more easily identified and mapped to url pattern and so forth. How do we deal with custom placeholders we dynamically create, and use them for generating url?
View 6 Replies