How to host / point asp.net website as umbraco sub site - asp.net

I have two website one is umbraco site and other one is asp.net site both on different location on same server
1) Umbraco site ( umbraco V6 and IIS 7) And bind on let say Eg. http://localhost:8090/
2) Asp.net website. (Simple Asp.net Site)
Now I have added Asp.net website as Application in umbraco web site IIS and given Alias let say AspSubSite
My umbraco site is running fine. But when I try to access asp.net site by URL http://localhost:8090/AspSubSite
It is not working.
I have try adding respective Url to umbraco config key “umbracoReservedUrls” but that also didn’t work

You have to add the folders to exclude (/aspSubSite) in the web.config of the umbraco installation.
Umbraco will not interfere at all with this folders. To do this, add the folder to the umbracoReservedPaths in the appSettings section of the web.config.
<add key="umbracoReservedPaths" value="/umbraco,/install/,/aspSubSite/" />
(leave the existing paths, but just add your path at the end.)
Note: this will exclude ALL umbraco functionality from this folder. Including rendering partial's, macro's, ... Only do this if you really want to do this. If you want to use e.g. a common menu, this won't work anymore.

Related

ASP.Net Website Routing

I have an ASP.NET website in framework 4.0
This website contains a subvirtual directory say directory1.
I want to add routing like when I type in browser
www.mydomain.com/funds it will get contents from www.mydomain.com/directory1
Example 2
**www.mydomain.com/funds/page1**
it will get contents from
**www.mydomain.com/directory1/page1**
URL in browser should remain **www.mydomain.com/funds/page1**
I have added reference of System.Web.Routing for this purpose. Initially tried with routes.MapPageRoute but there are no physical pages as directory1 is an wordpress website.
Any suggestions will be appreciated
Thank you
You may try URL Rewrite if you're using IIS for hosting website.

IIS Site inside another site, different web.config

I have an MVC web app on my iis with windows authentication. I have a folder called Content which holds all of my images.
I want that the Content folder will be freely excessed so I converted the Content folder to an application. The problem is that my main web.config is being read and it looks for WebGrease in Content/bin which it obviously cant find.
Is there a way to make the Content web app use a different web.config?
I succeeded by wrapping some of my web config sections in my parent's web.config with the location tag
https://msdn.microsoft.com/en-us/library/b6x6shw7(v=vs.100).aspx

404 When Serving .cshtml in IIS 6

I'm trying to get an ASP.NET WebPages (Not MVC) site up and running with IIS 6, but I can't get it to serve .cshtml pages - It just spits back a 404 error every time. I've confirmed that it can serve .html and .aspx pages with no problem. So far, I've done the following:
Install ASP.NET 4.0 (aspnet_regiis -i)
Configure site to use ASP.NET 4.0 (aspnet_regiis -s ...)
Allow ASP.NET v4.0 Web Service Extension
Map aspnet_isapi.dll as handler for .cshtml files in Application Configuration (And as a wildcard mapping, no dice)
Add .cshtml to MIME types in Application Configuration
Ensure only ASP.NET 4.0 applications are in the app pool
Add <modules runAllManagedModulesForAllRequests="true" /> to web.config
Ensure that necessary .dll's are in the site's bin folder
Give "Everyone" group full control of the site folder and subfolders
I have a working site on the same framework that I set up a while back (And failed to document my process, lesson learned), so I tried exporting that site's config, creating a new site from file, and pointing it at the proper directory for the new site, but I'm still getting a 404.
I know that there are a whole lot of IIS/ASP.NET questions out there already, but every one I've seen is either not applicable to my situation (A lot of the MVC ones), or was solved by one or more of the things I've already tried.
Anyone have a clue as to what could be causing this?
CSHTML is templated page served by the Razor engine. Try opening an ASPX Page.
For serving cshtml, you need the Razor Engine configured.
Also, CSHTML are served differently based on the Routing configuration

MVC mobile site as subdomain in Webforms site

I have an existing webforms project, and I want to add my new MVC4 (mobile-focussed) site to it, as a subdomain. I also want it to be able to access the session variables from the webforms site. The idea is that the user logs in on the webforms site, sets a session variable and gets redirected to the mobile site (on the subdomain).
Initially I have added my MVC site to the webforms site, by making changes to the web.config, global.asax (for routing etc.), Controllers, Views and other folders at root level. This allows me to access the session variables. However because the webforms site is well-established (old) there are implications to changing the web.config (least of all re-testing). Hence the need for a subdomain.
Is it as easy as dropping my MVC site's folder into the Webforms root, so it has its own web.config, and changing the global.asax to route to it (and then creating a subdomain)? Will I still be able to access the session variables in the subdomain?
You can create a new project for the MVC mobile, configure the domain binding in IIS in something like that m.mydomain.com.
In the web.config of the two you define the same main domain:
<httpCookies domain=".mydomain.com"/>
Here start the difficoult task, you need to play attention to share the same machineKey in the two projects and probably you need to add an HttpModule depending on the selected session scenario.
Take a look on this article that can help you on some guidance.
To share the session, I implemented this from Microsoft. It is a HttpModule.
http://support.microsoft.com/kb/2527105
There was some additional work to do - I felt this article assumes you know a little about IIS. For example I had to manually add the module using IIS Manager.
I managed to get it to work in IIS7 by manually adding the Module using IIS Manager.
(Open IIS Manager -> select the application -> click modules (top right) -> add the SharedSessionModule by clicking 'Add managed module'.
Name: SharedSessionModule
Type: <namespace>.SharedSessionModule
(a dialog box said it could not find the assembly but at runtime it was fine)
Then Restart IIS.
The problem I then had was "session state is not available in this context" when serving up non-page items like images, .pdfs etc. Before I solved this, I have been asked to use my initial method (side-by-side) so I have not found how to change this BUT there are many suggestions on SO and other sites.

How to base my ASP.NET website out of a specific URL directory?

I've got IIS 7 serving up my ASP.NET MVC website. It's the only site that I have configured in IIS. When I access the site, the site is based out of the root URL directory. For example, my site would be accessed like this: http://example.com/index.html
How can I configure the ASP.NET site to be prefixed by a specific URL directory? I'd like it to be something like this: http://example.com/application/index.html
Is this something I do in the ASP.NET configuration or within IIS itself?
You can create an "Application" for your site (right click on your web site in IIS Manager and choose "Add Application") and give it the directory name that you want. This way you can have, for example, multiple applications under the same domain e.g. http://example.com/application1/whatever and http://example.com/application2/whatever.
This article describes the differences between Sites, Applications and Virtual Directories:
http://www.iis.net/learn/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis

Resources