Creating a custom 404 page.

# Removed do to email appearing on Google search. #
Last edited by MindTooth (2011-01-01 21:57:05)

The way I have done it in a very simple way is to create an .htaccess file in the root directory of the site in question with the following lines:
# serve custom error pages
ErrorDocument 400 /SMART/errors/400.html
ErrorDocument 401 /SMART/errors/401.html
where:
> SMART in the directory name (root directory) where your index.html or index.php or index.py  file resides.
> errors is the sub-directory where all the different error files exit.
And that's it. Make sure you do not allow the .htaccess file to be accessible by web users (make it non-browsable).
That's it.
Hope this helps.
R.
Last edited by ralvez (2009-11-28 16:25:58)

Similar Messages

  • Custom 404 Page Not Found, can't get it to work...

    Environment: 1 CF webserver, 2 websites on the webserver
    (www.example1.com,www.example2.com)
    Problem: I want to create a custom 404 page not found for
    each site.
    I can't use the "Site-wide Error Handler " in the CF
    administor because it makes the 2 sites share the same 404
    template. I've also tryed to set the IIS Custom Error properties
    but when i do that I still get the ColdFusion defined (not my
    custom page) 404 message. Help.. I'm sure there is a way to do this
    some how... Thx

    Forgot to mention, the 2 sites are in seperate folders.
    Thanks

  • Having issues setting custom 404 page...

    Hey all,
    I'm not sure if I'm missing a step, I created a custom 404 page ("404.html") and it's in the root of the website folder.  Under Websites (tab) > Server Website, I click Advanced Settings and set the custom error page to "/404.html", yet entering, say, website.com/abc, still brings me to the generic Apache 404 page.
    I also tried specifying the 404 page as "/404" and "404.html", and I tried adding it to the index file list.. No dice.
    I'm sure I could do it manually via the .htaccess file, but before I do that (and before I inquire about doing that), I want to make sure I'm doing everything I should be doing through the Server App.
    Any ideas?

    Okay, I ended up creating and using a .htaccess file to override Apache's default settings, since I had issues saving changes to the .conf files in Library/Server/Web/Config/apache2, it's very locked down, and for good reason of course.
    For those with the same issue,
    0.5) In OS X Server app's Website settings, click "Advanced Settings" and check the "allow overrides using .htaccess files" box.
    1) Create a new document in your favorite text editor.  I used TextWrangler, free from the App Store.
    2) Copy the text
    ErrorDocument 404 /pathtofile
    and change /pathtofile to the path to your custom 404 page, which can be HTML or PHP. 
    3) Save the file as ".htaccess" ideally into the root of your website folder directly, because the dot at the beginning makes it hidden, so you can't save it to the desktop and move it later (unless you show hidden files via that Terminal command)
    4) Done!  You don't have to restart Apache or OS X Server or OS X for the change to take effect, just go to yoursite.com/someRandomURLthatDoesn'tExist and watch the magic.
    Courtesy of http://askubuntu.com/questions/53199/custom-apache-404-page and Google.

  • Custom 404 page

    Hi,
    I have created a custom 404 page called 404.cfm. I am usingCF8 on IIS6. In IIS 6 I specified this custom 404 page as a File. When a user types a wrong address in IE, I can see my custom 404 page. But when I type the wrong address in Firefox, nothing happens. In Firefox I do not see my custom error page.
    If I had setup page incorrectly, then I shouldn’t have been able to see the custom 404 page in IE. Why Firefox is not displaying my custom page? Note that my custom page is a cfm not .htm or .html.
    Any idea as what is happening here.
    Thanks
    Joe Green

    When your page fires, it sends back a 404 header to the browser, and then the browser interprets that accordingly.  Firefox has a few built-in error pages that it can use instead of the 404 from the server.
    If you go to about:config in your browser, click the button and search for 'browser.xul.error_pages.enabled' - set that to false (not tried it here, just a
    guess).  Does that make it go away and show your custom page?
    UPDATE:  Scratch that - didn't work.  I'm sure there is a setting that makes firefox override the 404 error page system, I jsut can't seem to find it - try a google.

  • How to find broken url from custom 404 page?

    I have created a custom 404 jsp page and updated the web deployment descriptor with the code:
         <error-page>
            <error-code>404</error-code>
            <location>/jsp/custom-404.jsp</location>
         </error-page>Whenever I enter an invalid url or click on broken link (target does not exist), a 404 HTTP response arises and the custom-404.jsp is rendered. So far so good.
    Within the custom-404.jsp, I would like to know the original url (invalid link or broken link) so that I can send the administrator an email with the url details.But, I could not find any API to find this url?
    Can someone help here please?
    Thanks

    My bet is that it is available as referrer inside the error page in case of a redirect, or as Request URI in case of a forward.
    String referrer = httpServletRequest.getHeader("referer"); // Yes, with the legendary misspelling in it.
    // or
    String requestURI = httpServletRequest.getRequestURI();

  • Creating a custom 404 message

    This is somewhat beyond an iWeb topic, but I thought I'd try. ..
    I would like to create a custom 404 message because Google picked up on some of the pages that I have since deleted. My webhost says to create my custom error html page and to also create a text file called .htaccess, in which I have the following message:
    ErrorDocument 404 /MyCustomErrorPage.html
    I put both the custom page and the text file in with the other html files as directed, which gave me a different message (405, was it?), but it didn't show my custom page.
    Does anyone else have good instructions on how to do this?
    Thanks,
    roxpat

    Not all servers will let you put an .htaccess file in your space, so you may need to check that. Also it has to be at the topmost level of your space. The reference to your custom error page has to be accurately reflect where that page is in the file structure of your space.

  • Create a custom Master Page in SharePoint Foundation 2013

    Hi,
    I am new to SharePoint foundation.
    I am trying to create a custom master page and save it as template, so that i can use it for all other sub sites. But i don't know where to start. Also i tries searching in Google, i got results for share point and not for share point foundation.
    So, Please give me a step by step procedure or a link to step by step procedure on how to create a master page, save it as template and use it for a sub site.
    Thanks in advance,
    Gowtham R

    Few points to note related to SharePoint Master page:
    You don't need to create master page template. If you deploy your master page in site collection level you can reuse the same master page in subsites without copying again and again, rather just by referencing
    You have not mentioned how you are going to deploy your master page. If you have any Visual Studio (VS) solution already, try to add your  master page in the VS solution and deploy your master page (and other branding components) as SharePoint WSP
    solution.
    Deploying master page will not activate the master page, you need to use some kind of 'Web Level Feature' to activate your branding - the feature will basically set the master page property of SharePoint site to your custom master page.
    Please follow the links below for steps by steps instructions (and you will find many just by googling 'sharepoint master page visual studio'):
    http://frederik.se/how-to-deploy-a-custom-master-page-in-sharepoint-2013-using-visual-studio/
    http://joshuaorimogunje.wordpress.com/2011/10/05/how-to-create-custom-master-page-for-sharepoint-2010-using-visual-studio-2010/
    http://blogs.msdn.com/b/bobgerman/archive/2011/01/31/packaging-master-pages-and-page-layouts-with-visual-studio-2010.aspx
    http://go.limeleap.com/community/bid/291931/Creating-a-Custom-SharePoint-Master-Page-with-jQuery-Using-Visual-Studio
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Custom 404 pages in Lion web server?

    Tried searching this forum on this, and either I get tons of 404 stuff about iWeb (search bar doesn't let you specify a forum) or try to add lion server to the terms and get nothing. So, here goes...
    I just migrated a web site over to my Lion Server system from a paid Linux host.  On that host, my custom 404.shtml file showed properly when I deliberately entered a bad URL for the site. On the Lion Server I just get the default white page.
    Is there a way enable the custom 404 page on the Lion Server Web and, if so, how?
    Many thanks in advance!

    Okay, maybe Lion Server's setup can't handle .shtml page definitions by default.  No problem, I just changed the page to 404.html and redirected to it in the .htaccess file. Not as elegant as before but it works.

  • Custom 404 Page not found

    Hi All,
    I want to replace the default 404 Error page with my custom page.  So, when the user type in something like, http://localhost:50000/indexnotavailable.html (indexnotavailable.html is really not available), they will be going to my custom 404 page. 
    I have been looking through the forum and found some suggestion to put <error-page> tag to the web.xml file of the application which required a custom 404 page.  My question is, where can I do this for the scenario I described above? 
    Thanks,
    Johannes

    Forgot to mention, the 2 sites are in seperate folders.
    Thanks

  • How to create a custom search page

    Hi,
    i would like to create a custom search page. I need to have a textbox for the text where i would like to search and a set of refiners, but in form of DropDown Lists. Under these elements i would like to have the search results.
    Is this possible?
    Where can i begin and for what do i have to look for?
    Best Regards
    Bog
    Developers Field Notes | www.bog1.de

    Hi,
    start with those articles
    http://msdn.microsoft.com/en-us/library/office/ms551453(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/office/hh144966(v=office.14).aspx
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/03/09/how-to-build-a-custom-advanced-search-control-for-enterprise-search.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Setting a custom 404 page for a mysite verizon web site

    I have a personal web site at mysite.verizon.net/naesdraw/index.htm.
    I have been trying for awhile now to get a custom 404 page set up on it, naesdraw/404.htm
    I looked for information on this but nothing I've tried has worked, .htaccess, nothing. The .htaccess(before I removed it from the root) said :
    ErrorDocument 404 http://mysite.verizon.net/naesdraw/404.htm
    From things I've read, I'm begining to think that it is an issue on the server side of the operation - not me.
    Any suggestions on how to solve this? I'm entering the site to be judged soon, and I'd like to have it ready, since this is the last year I can enter it.

    it is server side.
    if only it were as easy as placing a 404.htm in the root dir lol.
    ... and by the way, i like turtles

  • How do you create a custom size page?

    I"m trying to create a card but my sizes are different than what the templates have. How you you customize a new page? Also is there a way to know the sizes of Templates before you open up a page?

    If you are asking about Pages 09 on your desktop, you can download a copy of the user guide under the Help Menu, and the Pages 09 forum is here:
    http://discussions.apple.com/forum.jspa?forumID=1302
    (this one is for the ipad version, which is different in a lot of ways)
    From the Pages 09 help files:
    +To set paper size and orientation:+
    +Choose File > Page Setup.+
    +In the Page Setup dialog, choose the printer you will use from the “Format for” pop-up menu.+
    +Choose a standard paper size from the Paper Size pop-up menu.+
    +If you want to set a custom paper size, choose Manage Custom Sizes from the pop-up menu. Otherwise, go to step 7.+
    +Click the Add button, and then enter values in the Page Size fields.+
    +Either choose your printer’s default margins from the pop-up menu, or enter your own values for margins in the Left, Right, Top, and Bottom fields.+
    +If you want to change the custom size’s name, double-click the name in the list and enter a new name.+
    +Click OK.+
    +Choose the new paper size you named from the Paper Size pop-up menu, and then click OK.+
    +Select an orientation option using one of the buttons at the bottom of the Page Setup dialog.+
    +To make an image larger or smaller to fill more or less of the paper, type a percentage value into the Scale field, and then click OK.+
    +A value less than 100% makes the image smaller; a value greater than 100% makes the image larger.+

  • How to create a custom xml-page?

    Hi,
    I am trying to create a page that renders a xml format. For this, I created a page template in which I want to have an empty Header. Apex complains that the header is required and that the line <head>#HEAD#</head> should be included.
    The result is that the xml is not valid.
    Any ideas?

    JoepH wrote:
    I am trying to create a page that renders a xml format. For this, I created a page template in which I want to have an empty Header. Apex complains that the header is required and that the line <head>#HEAD#</head> should be included.
    The result is that the xml is not valid.
    Any ideas?Rather than an APEX page, use an On-Demand Process if your XML is generated using PL/SQL, or a report with the export: XML template if it's produced in SQL.

  • Custom 404-page for a single directory ?

    Is it possible to change the 404 error response for a single directory (and ist
    subdirectories)? Like I can do with a ".htaccess" - file on an apache webserver?
    I know it's possible to do it global with weblogic.httpd.errorPage.xxx=URL in
    weblogic.properties. That's not what I like to do.
    Thanks in advance for any help.
    Bert

    [att1.html]

  • Custom Error Pages (404 & 500) not invoked (JSF 1.2 & Websphere 6.0.1)

    Hopefully this is very obvious to some of the experts here. I'm trying to have my custom error pages (404 & 500) displayed, but in stead I get the normal system output text (ugly). The web.xml has been configured to apply the FacesServlet to all pages ending with "jspx". What I now get is the following: Whenever a page ending with .jspx cannot be found, the custom 404 page is IGNORED, however, when I don't use .jspx, but .jsp for example, IT WORKS. Below is my web.xml. I have already tried to make the error pages plain html, and also moved them to the root directory, no luck.
    Oh yes, running on RAD 6.0.1, Faces 1.2.
    Please if someone could guide me here...
    ########## SNIP ##########
    <servlet id="Servlet_1212573625706">
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>
    javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>-1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>JS Resource Servlet</servlet-name>
    <url-pattern>/.ibmjsfres/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
    <error-page>
    <error-code>500</error-code>
    <location>/includes/errorPages/error500.jspx</location>
    </error-page>
    <error-page>
    <error-code>404</error-code>
    <location>/includes/errorPages/error404.jspx</location>
    </error-page>
    ########## SNIP ##########

    I recognize this as an appserver bug (yeah, it's Websphere).
    Websphere (and the older versions of Apache Tomcat where it is actually based on) doesn't expect the error-page to be a dynamic servlet-served page, but as a static page. It roughly handles as follows: get the error-page location from web.xml, test its existence on the disk file system, if positive then go ahead, but if negative then display default error screen.
    The file with .jspx extension does not physically exist on the disk file system. A workaround for which I remember it worked in WAS 5.x is to create physically that file (empty content is allowed) on the disk file system. So create a blank file with jspx extension at the same location.

Maybe you are looking for