I am using using Umbraco 4.7 and my server is IIS7 was wondering what is not going right for me. I basically want to make a custom error page (404) and everything I have tried is not working, checked the forums, but it is still showing the same problem.
I have edited my umbracoSettings.config
<errors>
<!-- the id of the page that should be shown if the page is not found -->
<!-- <errorPage culture="default">1647</errorPage> -->
<!-- <errorPage culture="en-US">1647</errorPage> -->
<error404>1647</error404>
</errors>
Also I have looked about saying adding this to the web.config file.
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/error.aspx" responseMode="ExecuteURL" />
</httpErrors>
Any help would highly appreciated. I am a complete novice to IIS and anything involving network settings.
Make sure that 1647 is node id of the 404 page.
Also add the below code in the system.webServer tag in your web.config.
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="400" path="/404" responseMode="ExecuteURL" />
<error statusCode="404" path="/404" responseMode="ExecuteURL" />
</httpErrors>
Hope this works...
Just in case someone stumbles across this like I did when researching a similar problem with Umbraco 7, setting trySkipIisCustomErrors value to true in config/umbracoSettings.config file did it for me.
<web.routing
trySkipIisCustomErrors="true"
internalRedirectPreservesTemplate="false">
</web.routing>
I experienced the same problem, and the solution suggested by Sobin P Samuel worked for me (just copy and paste the httpErrors element directly to the system.webserver section in your Web.Config-file), so I guess this is also what resolved it for paulstewart185...
Please note that according to http://our.umbraco.org/wiki/install-and-setup/configuring-404-pages the solution for IIS 7.5 would be to add the following to the system.webserver section:
<httpErrors existingResponse="PassThrough"/>
Related
This site works fine everywhere except in IOS.
http://www.pepedivecenter.com.
It works in Windows with Firefox, Chrome or IE.
It works in OSX with Safari or Chrome
It works in Android phones
BUT, it does not work in IOS (iPhone or iPad) using Chrome or Safari!
When I try to open the site in an iPad or an IPhone with Chrome or Safari I get a TOO MANY REDIRECTS error.
The web.config is pretty clean:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="PHP_via_FastCGI" />
<add name="PHP_via_FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\php\php-cgi.exe|-d open_basedir='D:\XVRT\pepedivecenter.com\Html;D:\XVRT\pepedivecenter.com\html\new'" resourceType="File" requireAccess="Script" />
</handlers>
<security>
<ipSecurity allowUnlisted="true">
</ipSecurity>
</security>
<staticContent>
<remove fileExtension=".htm" />
<remove fileExtension=".html" />
<mimeMap fileExtension=".html" mimeType="text/html" />
<mimeMap fileExtension=".htm" mimeType="text/html" />
</staticContent>
</system.webServer>
</configuration>
I tried enabling and disabling the friendly urls,
the site is running under IIS so I tried several configurations with web.config
I cleaned joomla's cache and redirects.
I cleaned the browsers cache and cookies.
I updated everything to the last version (joomla 3.6.5)
but the problem continues.
How can I troubleshoot this problem? any ideas?
tks!
I found a workaround.
The problem was caused by the Joomla plugin "System - Language Filter".
I disabled this plugin and now the site works in IOS.
I created a web application targeting 4.5.2 framework and using IIS8.
The starting page should be Default.aspx, It used to work OK on framework 3.5 but on framework 4.5.2 it redirects me to Domain\Default.aspx?ReturnUrl=%2f web page even after I've logged in correctly.
I know it can be fixed by adding some code in Global.Application_BeginRequest in Global.asax but I really want to know the real cause of this behaviour and which dll added by .net v4.5 makes this redirect to the root path ?
Well I was trying to fix this loop and it looks it was an authentification issue with .net framework 4.5
you just need to remove the authorize section of the login page in your web config file :
<system.web>
<httpRuntime targetFramework="4.5" />
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<add extension=".config" type="System.Web.Compilation.IgnoreFileBuildProvider"/>
</buildProviders>
</compilation>
<authentication mode="Forms">
<forms loginUrl="Default.aspx" defaultUrl="yourlink" timeout="60" slidingExpiration="true"/>
</authentication>
<!--<authorization>
<deny users="?"/>
</authorization>-->
Also in section add this key to solve Unobtrusive Validation Mode in ASP.NET 4.5
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
and the loop to root path is gone!
I'm trying to pick up the windows username when debugging in Visual Studio 2013. I am simply using:
httpcontext.current.user.identity.name
If I run this on my Dev Server it works fine, if I run it in debug mode on any previous version of Visual Studio it also works fine.
My problems is - If i run this on visual studio 2013 I get an empty string.
My web config is as follows.
<system.web>
<authentication mode="Windows"/>
<identity impersonate="false"/>
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
<customErrors mode="Off"/>
</system.web>
I had just upgraded to VS 2013 from VS 2012 and the current user identity (HttpContext.User.Identity) was coming through as anonymous.
I tried changing the IIS express applicationhost.config, no difference.
The solution was to look at the properties of the web project, hit F4 to get the project properties when you have the top level of the project selected. Do not right click on the project and select properties, this is something entirely different.
Change Anonymous Authentication to be Disabled and Windows Authentication to be Enabled.
Works like gravy :)
As I was researching this I found my answer, but can't find the answer on the internet, so I thought I'd share this:
I fixed my issue by modifying my applicationhost.config file. My file was saved in the "\My Documents\IISExpress\config" folder.
It seems that VS2013 was ignoring my web.config file and applying different authentication methods.
I had to modify this portion of the file to look like the below. In truth, I only modified the anonymousAuthentication to be false and the windowsAuthentication mode to true.
<authentication>
<anonymousAuthentication enabled="false" userName="" />
<basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="false" />
<digestAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="false">
</iisClientCertificateMappingAuthentication>
<windowsAuthentication enabled="true">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
</authentication>
In Visual Studio 2013 AND VS15 (but i guess if the same for all other version) just press F4 and change this two properties:
-Anonymous Authentication: Disable
-Windows Authentication: Enable
In VS2013 F4 on your project to view properties window and disable Anonymous access and enable "Windows authentication"
Then it will work. No need to change anything else
VS 2015 changes this. It added a .vs folder to my web project and the applicationhost.config was in there. I made the changes suggested (window authentication = true, anon=false) and it started delivering a username instead of a blank.
Open up the applicationHost.config file located in the C:\Users[userid]\Documents\IISExpress\config folder. Inside this file change the overrideModeDefault of anonymousAthentication and windowsAuthentication to "Allow"
<sectionGroup name="security">
<section name="access" overrideModeDefault="Deny" />
<section name="applicationDependencies" overrideModeDefault="Deny" />
<sectionGroup name="authentication">
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
<section name="basicAuthentication" overrideModeDefault="Deny" />
<section name="clientCertificateMappingAuthentication" overrideModeDefault="Deny" />
<section name="digestAuthentication" overrideModeDefault="Deny" />
<section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Deny" />
<section name="windowsAuthentication" overrideModeDefault="Allow" />
</sectionGroup>
Next change lockItem to be "false" for AnonymousAuthenticationModule and WindowsAuthenticationModule
<system.webServer>
<modules>
<!--
<add name="HttpCacheModule" lockItem="true" />
-->
<add name="DynamicCompressionModule" lockItem="true" />
<add name="StaticCompressionModule" lockItem="true" />
<add name="DefaultDocumentModule" lockItem="true" />
<add name="DirectoryListingModule" lockItem="true" />
<add name="IsapiFilterModule" lockItem="true" />
<add name="ProtocolSupportModule" lockItem="true" />
<add name="HttpRedirectionModule" lockItem="true" />
<add name="ServerSideIncludeModule" lockItem="true" />
<add name="StaticFileModule" lockItem="true" />
<add name="AnonymousAuthenticationModule" lockItem="false" />
<add name="CertificateMappingAuthenticationModule" lockItem="true" />
<add name="UrlAuthorizationModule" lockItem="true" />
<add name="BasicAuthenticationModule" lockItem="true" />
<add name="WindowsAuthenticationModule" lockItem="false" />
Making these changes will allow the existing web config settings to override what is in the applicationHost file for IIS Express.
You could also modify the project properties for your web project, choose "Web" from left tabs, then change the Servers drop down to "Local IIS". Create a new virtual directory and use IIS manager to setup your site/app pool as desired.
I prefer this method, as you would typically have a local IIS v-directory (or site) to test locally. You won't affect any other sites this way either.
It appears that the right answer is provided by user3149240 above. However, As Neil Watson pointed out, the applicationhost.config file is at play here.
The changes can actually be made in the VS Property pane or in the file albeit in a different spot. Near the bottom of the applicationhost.config file is a set of location elements. Each app for IIS Express seems to have one of these. Changing the settings in the UI updates this section of the file. So, you can either change the settings through the UI or modify this file.
Here is an example with anonymous auth off and Windows auth on:
<location path="MyApp">
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</location>
This is equivalent in the VS UI to:
Anonymous Authentication: Disabled
Windows Authentication: Enabled
F4 doesn't always bring me to this panel. Besides, it is often said that a picture is worth a thousand words.
I've place this in web.config <system.webServer>
<httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" subStatusCode="-1" path="/cv/" responseMode="ExecuteURL" />
</httpErrors>
The path that is used temporarily here [myapplication]/cv/ returns a page.
But if I go to [myapplication]/[anything that doesn't exists] to get a 404 response, juste nothing happens.
This is currently working on my old web form site, but I can't get it working on a MVC4 site.
How can I make this work ? (I don't want to use the "Redirect/File" methods)
This is what I have in a current MVC 4 project:
<customErrors mode="On" defaultRedirect="~/Error/General">
<error statusCode="404" redirect="~/Error/Http404" />
</customErrors>
I have an Errors controller, and views for "General" and "Http404" (action methods).
Works like a charm.
Part of the problem might also stem from the fact that the <customErrors> tag is not a valid child of <system.webServer>. Try putting it in <system.web> instead.
While trying to create a mole for some unit tests I noticed that some functions were not being 'moled'. Some functions were appearing in the xxx.moles.xml file while others were not.
To resolve this issue, I've tried reinstalling 'Pex and Moles', deleted files in the MolesAssembly folder, restarted the computer, etc.
Finally, I simply opened a console window and ran the moles.exe command from the command prompt.
"c:\program files\microsoft moles\bin\moles.exe" assembly.dll /op:"MolesAssemblies" /msbuild:"c:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
The first time I ran this, I received a message:
Moles : info : compilation : assembly metadata hash unchanged,
skipping code generation.
After deleting the moles in the MolesAssemblies folder, I ran the moles.exe command again and all my functions are now appearing in the xxx.moles.dll and xxx.moles.xml files.
Does anyone know why the mole generation does not work when building inside Visual Studio 2010, but it works perfectly from the command prompt?
I found the issue...I modified the .moles file before and only certain classes were added. I simply had to add more 'TypeName' and the classes/functions were included.
The reason that it 'worked' by using the moles.exe command was because I did not use the .moles file (I simply referenced the assembly). I changed the parameters for moles.exe to include the .moles file and the assembly and the results were identical to the output generated by Visual Studio. Once I notice that other parts of the code was breaking, I realized that the .moles file was incorrect.
I had something like this...
<Moles xmlns="http://schemas.microsoft.com/moles/2010/" >
<Assembly Name="Assembly.name" />
<StubGeneration>
<Types>
<Clear />
<Add FullName="Fullname_1_0" />
</Types>
</StubGeneration>
<MoleGeneration>
<Types>
<Clear />
<Add FullName ="Fullname_1_0" />
</Types>
</MoleGeneration>
</Moles>
I needed a second 'Add'
<Moles xmlns="http://schemas.microsoft.com/moles/2010/" >
<Assembly Name="Assembly.name" />
<StubGeneration>
<Types>
<Clear />
<Add FullName="Fullname_1_0" />
</Types>
</StubGeneration>
<MoleGeneration>
<Types>
<Clear />
<Add FullName ="Fullname_1_0" />
<Add TypeName="AdditionalClass"/>
</Types>
</MoleGeneration>
</Moles>
Be sure to REBUILD the test project, after modifying an assembly that is moled. Using the "clean" action on the test project will also fix this issue.