C# - How To Map SubDomain To The Subfolder
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
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
Mar 17, 2010
I want to change http://localhost:1190/Project/Subfolder/Default.aspx?Query=1
to
http://localhost:1190/Project/Images/Image.jpg
Tried somewhat below, no success:
Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, "") + @"/Images/Image.jpg"));
View 6 Replies
Apr 15, 2010
I've got a folder in my project on a live webserver, called "admin" with a file in it called "default.aspx". Now, I cannot access this folder like this: [URL] however, if I put a slash at the end, it works fine: [URL]
or, this works fine, too: [URL]
View 2 Replies
Jan 12, 2010
I'm trying to run a little ASP.NET project in a subfolder of my hosting. My domain is [URL], but i want to run my app in www.gorangligorin.com/testmvc. ASP.NET MVC runs with no problems on the top level, but not in subfolders.
The server says this (line 58 is colored red):
Line 56: ASP.NET to identify an incoming user.
Line 57: -->
Line 58: <authentication mode="Forms">
Line 59: <forms loginUrl="~/Account/LogOn" timeout="2880" />
Line 60: </authentication>
What can I do to make this ASP.NET MVC website work? This isn't hosted on my computer, so I don't have access to IIS configirations.
View 3 Replies
Oct 26, 2010
My site structure is like that I've 4 sub folders and few pages at roots when sub folder pages are viewed in browser their css breaks some of the images doesn't work well.
View 2 Replies
Mar 20, 2010
Using VS 2010, RC, VB, how do I change the subfolder attributes. When I publish and choose to delete all the files and folders, I have to recreate the security levels for them manually. I assume that I can have Web Config do that for me.
View 1 Replies
Mar 14, 2011
Why is it Intellisense only seems to show a file when it is directly in the app_controls folder:
<
add
tagName="footer"
tagPrefix="UC"
src="~/App_Controls/footer.ascx"/>
If the file is put into a subfolder:
<add
tagName="footer"
tagPrefix="UC"
src="~/App_Controls/BaseControls/footer.ascx"/>
it will not show in the Intellisense list.
View 4 Replies
May 14, 2010
I've been working on site for a client who has just informed me (having completed the work) they want to deploy the site into a subfolder of their exiting domain. The site uses a number of class files in the App_code folder and as well as references to several XML files and and siteMap that uses localised urls for navigation. Obviously all of this stops working as soon as you put it in a sub folder. Is there any way I can configure the site to treat the sub folder it will be placed in as the root?
View 3 Replies
May 25, 2010
I have a web application with root namespace called mywebapp The web application has as folder under root. Call it folder1. Now this folder contains a default.aspx page with code behind vb file class file. Call it subdomain1. Now when the default.aspx page under folder1 is requested, following error is shown Parser Error Message: Could not load type mywebapp.subdomain1. There is no problem what so ever when I run it localhost. Error is only thrown when the page is requested online. I also made some changes in a page in root folder to verify if the mywebapp.dll is correctly copied to the webserver. All the changes done for root folder are correctly reflected online
View 13 Replies
Oct 26, 2010
In my project I have a website that has 2 sides, the client side and the management side. Everything is completed and works fine.
My idea was to place the management files in a separate folder (mysite.com/admin) the problem is that when I moved the files it could not compile because my admin pages inherit from a class in the app_ folder and looks like it cannot access it.
I wanted to compile the files in the app folder into a DLL but when I try, it gives me a error in the namespace System.Web.UI.Security and the WebControls ns...
How can I access my classes if my files reside in a subfolder within the same application. If I take the files out of the subfolder everything works fine
View 2 Replies
Apr 21, 2010
I currently have a dedicated server running a number of sites, one of these sites I would like to add a subfolder to which runs a seperate index.html file, so effectively it looks like a different site.
I am struggling to acheive this, can anybody give me the steps involved to make this happen?
To clarify, i have a web address for example www.mydomain.com and would like users to browse to www.mydomain.com/subfolder and open up a sub folder.
View 1 Replies
Nov 19, 2010
I have a Domain like [URL] that is pointed to a virtual directory on my webspace like [URL]. The folder structure on my webspace is (off course) like this
root
bin
VirtualDirectoryName
bin
Content
Scripts
Views
Web.config
Global.asax
If i call now [URL] i get the Site without CSS and the links are [URL]. I used the default and almost empty default "Internet Application". So the routing is default and all links are created with @Html.ActionLink. i tried so many things but i cant get it working. In my local environment i can affect that with IIS settings but (off course) i do not have access on the IIS settings of my host.
View 2 Replies
Oct 26, 2010
I have the following site structure:
- Site
- Administration
- Resources
- Home.aspx
Basically no unauthorized users should be able to use the system, so they get properly redirected to Home.aspx which has the login controls.
The Administration folder contains a page that should be only accessible to authorized users, but also only to users that belong to specific roles. So I have a web.config inside the Administration folder as this:
[Code]....
At first sight I'd say that this configuration would check that only SystemAdministrators and AccountManagers can access the SecuredPage.aspx. But it doesn't. If I log into the system as a regular user (not part of the roles) and then go to http://mysite/Administration/SecuredPage.aspx, it allows me in, instead of showing a "your not authorized" message.
I've also tried with location=Administration so to secure the entire folder, but same results.
View 1 Replies
Jul 15, 2011
He has a project set up with the master page and the default.aspx at the root level of the project.He then has several layers of subfolders.On subfolder is DynamicData, and under that PageTemplates and he has a file in there called ListDetails.aspx the uses the same master page on the root. If he sets the ListDetails.aspx as the start page, it says resource can't be found when he runs it.if he sets a redirect to it as:
Response.Redirect("~DynamicDataPageTemplatesListDetails.aspx"), it also says resource can't be found.
View 1 Replies
Mar 7, 2011
My restricted files are all stored in ~/Secured folder on the root. Authorized users have no trouble accessing aspx files in that folder. Recently I added a part of an application whose files I wanted to keep separate and created a ~/Secured/HR folder. I am getting a "resource not found" error trying to use any aspx file in HR folder even after user successfully logs in, as if the file does not exist at all. Here is my web.config security settings:
[Code]....
Do I need to configure security for that folder separately?
View 1 Replies
Mar 26, 2011
So my website works great on my local computer. It also works fine when I use the Copy Web Site feature in Visual Web Developer 2010 Express. But I do not want all of my files and the default.aspx to be sitting at the root of my domain name. I want it to be in a subfolder.
So again, it works fine when it's sitting at www.domainname.com
But when I use my FTP program to move the files to:
www.domainname.com/subfolder/
I get an error when I try to visit the site. It's just a general runtime error and does not display the specific error message. It obviously must have something to do with when I MOVE the files/folders from the root of the domain to the subfolder?
View 2 Replies
Feb 28, 2011
I have a web site running on IIS7 on a remote server. I would like to do the following: Create a new subfolder under the root virtual directory. Create a new app pool. Add this new app pool to the new subfolder Normally, I would do this manually in IIS by first creating the app pool, and then right-clicking the sub folder an choose "add application", but I need to do this programmatically in C#. I've managed to make the above points 1 and 2 work, but I can't find the way to adding the application to the sub folder. This is the code I have used so far for 1 and 2:
[Code]....
So, I need to add "MyAppPool" to the "NytSite" folder. Is this even the correct way to do this?
View 1 Replies
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
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