Problem with 404

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/18/2014 11:29:59 PM
Gravatar
Total Posts 44
Regards, Dilip Wanave

Problem with 404

Hi,

I am using 2.4.0.3 of the mojoPortal in which I am facing a problem with handling 404.

If I will enter URL like http://mydomain/nopage.aspx which does not exists then it properly navigates me to Page Not found and this page has default site skin also, but when i enter a URL like http://mydomain/nopage (without .aspx) then I get crash with error "HTTP Error 404.0 - Not Found".

So I want to redirect user to Page Not Found in both the cases (page with .aspx andwithout .aspx).

so how can I achieve this?

Thanks,

Dilip

8/19/2014 6:54:46 AM
Gravatar
Total Posts 44
Regards, Dilip Wanave

Re: Problem with 404

Hi,

I have resolved this problem using below code which is added under <system.webserver>

<httpErrors errorMode="Custom" existingResponse="Replace">
    <remove statusCode="404"/>   
    <error statusCode="404" responseMode="ExecuteURL"    path="/pagenotfound.aspx"/>    
  </httpErrors>

And this is useful for IIS7 and above only, it will not solve problem for IIS6.

 

Thanks,

Dilip

 

5/14/2015 1:11:21 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Problem with 404

Nice one - this also solved a similar problem for me on 2.4.0.8.

On my site, with extensionless URLs, entering a bad url without aspx gave a standard 404, and entering a bad url ending in .aspx crashed the site (which I think is the opposite of what you had). This was on Server 2008 R2, .Net 4.5, Integrated app pool.

You must sign in to post in the forums. This thread is closed to new posts.