Change 404 Error Page Drupal
Contents |
Savov on October 01, 2015 | Drupal Twitter One of our users didn't like the generic "Access denied" message for restricted pages. So we created this tutorial for him.This tutorial will show
Custom 404 Page Drupal 7
you how to create custom error pages for 403 (Access Denied) and also 404 404 error page template (Not Found) errors.Step #1. Create the new error pagesFirst, let's create the content that we'll use for the new error pages.
How To Fix 404 Error Page
For example, go to Add content > Basic page. Create your page as usual. In this example, I'm creating a 404 error page. You can also create a 403 error page. We need to find 404 error page html the paths of our new error pages.You can look in the URL bar of your browser to find the paths: Step #2.Add the custom pages to the Configuration Go to Configuration > Site information: Enter your new paths into the 403 and 404 error page boxes. Click "Save configuration". Step #3.TestFinally, test to make sure they work.That's all there is to it. Congrats! Drupal makes it easy to add the custom 404 error page design 403 and 404 pages.Note of cautionBecause this approach uses nodes (i.e. individual pieces of content), the 403 and 404 pages will show in search results. Also, anything that ranks pages based on popularity would likely display at least the 404 page.If either of the above are concerns for your site, consider using the CustomError module instead.About the author Nick is the Director of Support at OSTraining and you can find him in almost every area of the site, from answering support requests and account questions to creating tutorials and software. View the discussion thread. blog comments powered by DISQUS back to top Get these tutorials via RSS: The Drupal RSS Feed1 free monthif you buy the bookBlog Categories WordPress TutorialsDrupal TutorialsJoomla TutorialsCoding TutorialsOSTraining NewsWeb Design TutorialsBlog LicenseAll our blog posts are published under the Creative CommonsAttribution-NonCommercial license: You can re-use these tutorials. You can modify these tutorials. You must link back to our original tutorial. You can't use these tutorials commercially. Full license details. You can build great websites. We can help! You will get expert support and over 3,000 videos! Start a free trial!Our Training Video Training Books On-Site Training Our Books MySQL Explained Drupal 7 Explained Joomla 3 Explained Joomla Explained About OSTraining About Us Our Team O
all over the world. Join today Community Community Home Getting Involved Chat Forum SupportPost installation Custom 404 Error Page Posted by cornernote on May 5, 2004 at 10:41am Hello, I have drupal up and running, however when someone goes to a page that does not
404 Error Page Wordpress
exist they get taken to the index page. Where do I set the custom 404 error 404 error page not found page? Am I missing something simple? Best regards, Brett Log in or register to post comments Comments should be in your configuration page Dublin Drupaller
404 Error Page Text
commented May 6, 2004 at 7:12pm Am using the latest version of drupal, not sure if you are using the same, but, all I have to do to set the custom 404 page is do the following: a) log into https://www.ostraining.com/blog/drupal/custom-error-pages/ the site as an administrator b) create a new page that is going to be your new 404 error page..make a note of the link c) click through to the configuration page d) scroll down and there are options for re-directing for 404 errors and which page to go to. e) insert the link to your new error page here. f) save your configurations As an addendum I was getting a lot of "can't send header" errors when I was setting https://www.drupal.org/node/7570 up my first drupal site - which isn't a 404..i think it's a 500 error..or something like that.... It was a major pain in the arse...So I ended up setting up a special script that was like a "catch all" faciility that not only redirected the user to a custom error page, but emailed me as well with a reference to the error, time of day, etc. Please also note that I'm not an experienced programmer...even I was able to setup that "Catch all errors and email me" script. Came in very handy the other night when the site couldn't connect to the SQL...I would have been blissfully unaware, if I hadn't have got the automatic email from the script. Let me know if you want a copy and instructions...will be working late tonight(Thursday - it's 20:00 in Dublin) so will be hovering here for a while. Cheers Jason Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate Log in or register to post comments Hello, I am using version cornernote commented May 7, 2004 at 3:00pm Hello, I am using version 4.3.x so I think that is why I cannot see it in my config. I just checked the new version and it is there. Just having some teething issues upgrading. The reason I wanted to make the 404 was so that I could make it email me the error m
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads http://drupal.stackexchange.com/questions/34277/custom-template-for-404-error-pages with us Drupal Answers Questions Tags Users Badges Unanswered Ask Question _ Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Custom template for 404 error pages up vote 9 down vote favorite 2 A quick noob question here! How to set a theme to use a 404 error custom template for 404 error pages instead of using page.tpl ? theming share|improve this question edited Feb 16 '13 at 15:32 asked Jun 16 '12 at 10:54 Walid Baccari 48114 add a comment| 4 Answers 4 active oldest votes up vote 9 down vote accepted Follow these steps: Make a new page using the Panels module (Empty page or put in it any content) In admin/config/system/site-information set Default 404 (not found) page to your new page Override the template file for that page 404 error page (page--error.tpl.php) Remove all the regions you don't need and put your code share|improve this answer edited Jul 30 '15 at 11:27 kiamlaluno♦ 66.5k897192 answered Jun 16 '12 at 11:10 Ahmed 1,15321227 It worked. Thanks @Ahmed! –Walid Baccari Jun 16 '12 at 11:26 5 And one does not even need to use panels. Module handling a page or simplest "Basic page" node would do, too. –Mołot Oct 29 '13 at 8:55 1 Why would you need a contributed module to create a 404? –MrUpsidown Aug 19 '15 at 6:36 add a comment| up vote 23 down vote Yet another solution from this discussion that works without panels or other custom modules. In your theme folder locate template.php and write this code. Replace YOURTHEME with the name of your theme: function YOURTHEME_preprocess_page(&$vars) { $header = drupal_get_http_header('status'); if ($header == '404 Not Found') { $vars['theme_hook_suggestions'][] = 'page__404'; } } Whenever 404 occurs your page--404.tpl.php will be used. Remember to put "--" not "__" in your template file name. share|improve this answer answered Feb 9 '15 at 11:31 daniels 47148 This was exactly what I was looking for. Thanks! –Ryan Feb 24 '15 at 19:02 Remember to clear your cache if you just created the page--404.tpl.php file. –Blake Erickson Mar 10 at 17:20 For 403, the $header == '403 Forbidden'. –Henry Aug 24 at 20:42 add a comment| up vote 2 down vote If you want to have a customized 404 pa