. .
I'm trying to set up IIS 7 to use custom error pages, but I'm running into a problem that I can't seem to get around. I've looked nearly everywhere for an answer to this, and have come up empty.
Here's the deal: I open IIS, go into Error Pages (note: this is a classic ASP environment), and open Edit Feature Settings. I set my path type to Execute URL and set my path (for example purposes, let's say it's "/errors/SomeError.asp"). I also set it to "Custom Error Pages."
For the most part, it seems to be okay, but here's where I run into trouble.
I'm sure you've all seen the errors where your page partially loads, and the error appears in the middle of the page. (For example, you'll see your page template, and somewhere in the middle, you'll see your "Error 500 . . . " blah blah blah.)
The error page I created (the "/errors/SomeError.asp" I mention above) is a full page, complete with template and everything.
When an error occurs mid-page, it does not redirect to my custom error page. Instead, the page is "nested" -- that is, the full page appears right in the middle of the problem page -- so it looks like a full page within a full page.
I want it to go to the error page, not have the error page nested within the page.
How do I get around this?
Thanks in advance.
I just answered my own question.
Instead of setting path type to "Execute URL," I set it to "Redirect." Problem solved.
Related
I'm trying to support a CQ5 (5.5) installation developed by an outside firm for my company.
It appears that my company wanted a pretty 404 page that looked like the rest of the site, and using the custom Sling 404.jsp error handler to redirect to a regular page that merely says "Page Not Found" was the easiest way to do it. The problem is that the 404 page actually returns a 200 status code since it really is just a regular content page that bears a "Not Found" message on it.
This is causing us problems with Google and the GoogleBot, since Google believes all the old search links to now non-existent pages are still valid (200 status code).
Is there any way to configure CQ to return the appropriate 404 status code for the "not found" HTML page that we display? When I am in the CQ Author mode editing the page, I find nothing in page properties or in components that could be added to the page.
Any help would be appreciated, as CQ is not exactly my area of expertise.
You'll have to overlay /libs/sling/servlet/errorhandler/404.jsp file in order to do so - copy it to /apps/sling/servlet/errorhandler/404.jsp and change according to your specification.
And if you are looking specifically into setting appropriate response status code - you can do it by setting respective response property:
response.setStatus(404);
UPDATE: instead of redirecting to the page_not_found.html you might want to include it to the 404.jsp after setting response status:
<sling:include path="path/page_not_found.html" />
You can set the response code fairly easily with this sort of code: response.setStatus(SlingHttpServletResponse.SC_NOT_FOUND);
So for example, a quick-and-dirty implementation on your page_not_found.jsp would be as follows:
<%
response.setStatus(SlingHttpServletResponse.SC_NOT_FOUND);
%>
(or a longer-term/better implementation would be to set it via a tag and a tag library to avoid scriptlets)
If your page_not_found.html page is a static HTML page and not rendered via a jsp, you may need to change your 404.jsp so it redirects to a page that is rendered via a jsp for this approach to work. The status code is set by the server rendering the response. It is not something intrinsic in the HTML itself, so you won't be able to set this in a regular, static HTML page. Something must be done on the server to set this status code. Also see How to Return Specific HTTP Status Code in a Plain HTML Page
I am currently trying to implement an atom feed for my Umbraco website (The question is not Umbraco specific, please don't tag with 'Umbraco'). For testing purposes I've copied an atom feed that I found on the web (please don't tell anybody, it's probably illegal) and pasted the content inside a page template. The resulting output is an .aspx - page, which contains nothing but the pasted code:
Not working on aspx - page
As you can see, it is not working, the feed is shows as text, no subscribe options and the like. Accessing the feed with a C# atom API yields an exception, saying the feed type cannot be determined.
Now I've taken the exact same content and pasted it inside another file, this time with the ending .asp, which you can see here:
Working on asp - page
It works. It also works when I rename the file ending to .htm, .html or .xml.
My questions (I've got two) (thanks in advance):
a) Are atom feeds generally not working when the file ending is .aspx?
b) How can I provide an atom feed on an .aspx site, when I can't change the file ending?
Ok, found it thanks to this question:
SO Thread
There were blank lines on top of the document in the .aspx file...
Yesterday I was trying to rename my *.aspx , *.cs, *.designer.cs files and class as well. Now i got issue with properly loading master.page on any page in my website(even that pages which i don't rename). I have no idea what happend I'm sure i doesn't make any mistakes in rename(using refactor). Every page are white but when i push ctrl+F5 combination of buttons the same page are showed correctly. Now i strike my head over the wall;/
Anyone got something like this before?
I hope I describe this problem understandable.
Thanks for advance.
Edit: I've made it works just clicked ctrl+shift+del and cleared all from firefox browser and it's started works...
Trying adding the master page reference in the config file:
<pages masterPageFile="MySite.Master" />
That's normal if everything becomes fine, only after ctrl+f5, seems your browser has cached some old named files, and can't apply them to new templates.
But if it isn'tm try to check what could you miss.
1. Check aspx files' code file property on match to new names;
2. Check aspx files' master page file property on match to new master page file.
Open webbrowser's developer tool(e.g. firefox - firebug), and check console for error. That usually helps to determine the error reason.
I have an instalation of Umbraco 4.0.2.1. In internet explorer (6 / 7) i get an error when trying to insert a link using the tiny MCE rich text editor. basicaly what happens is i can choose the node in the site i want to link to but when i click insert it reloads but the tiny MCE popup does not dissapear and i get the following page error.
Line: 368
Char: 9
Error: 'the Form._SCROLLPOSITIONX.value' is null or not an object
code: 0
URL: "mydev server"/umbraco/plugins/tinymce3/insertLink.aspx
I dont get this problem in Firefox and i have other instalations of umbraco 4.0.2.1 in which this error does not occur. I have tried using WinMerge to comparing the code of the two instalations and they seem identical in all the places i can think would have an effect on tinyMCE ("bin", "umbraco_client\tinymce3", "umbraco\plugins\tinymce3")
I am pulling my hair out over this and any help would be very much appreciated.
I'm not sure about this, but at first glimps I noticed the URL in the error message:
"mydev server"..
My guess: the javascript code cant handle the quotes in the url.
possible solution: remove the space from your server name.
again, its just a guess, hopefully will solve your problem.
I'm stuck on (what I think is) a simple views issue.
I have a view with a page display, with a path of:
/mydir/%/%
Some URLs I would hit are:
/mydir/pc/2008/
/mydir/xbox/2007/
/mydir/pc/
%1 and %2 are different CCK fields. When I specify the path with both arguments:
/mydir/pc/2008/
it works great. But the one argument paths:
/mydir/pc/
/mydir/xbox
aren't working at all. I get a 404 page not found (and I did not select the 404 option in my view).
The breadcrumb links on this page:
/mydir/pc/2008/
link to
/mydir/pc/*
which just outputs a * to the screen. Sometimes I've been able to configure it to output all the right stuff with
/mydir/pc/*
but I don't want the * there, I just want
/mydir/pc/
I tweaked all of the argument settings for each argument in every way possible I can imagine, and I can't get my desired behavior, which is that this URL:
/mydir/pc/
just ignores or uses any match for the second argument and matches the first.
Also odd: The preview tool in the view works correctly, if I pass in just pc/ in the arguments box. The URL that is outputted in the views preview ouput is also correct: /mydir/pc/. But if I click on that (after saving), I still get the 404.
What am I doing wrong?
I figured this out. My path setting for the page display on the view was:
apocalypse/%/%
but should have been
apocalypse/%