Apache2 404 error page

apache2 404 error page

The most common custom error page is for a 404 error. However, you may want to create custom error pages for other Apache errors as well. These. Just add a custom error page handler in your site config file (and create the file of course). Code: Select all ErrorDocument 404 /404.html. in. Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up. Stack Overflow for Teams – Start. apache2 404 error page

Apache2 404 error page - scandal!

getting 404 not found - website with apache2 on ubuntu

Background:

I've installed apache2 and have tried set up virtual directories... but when I try to test the different sites, I keep getting 404 error messages.

The article /tutorial I've been following is located at: https://www.digitalocean.com/community/tutorials/how-to-configure-the-apache-web-server-on-an-ubuntu-or-debian-vps

I have the following folder structure in place:

In the /etc/apache2/sites-available folder, I have the following configuration files:

Here's what the webtest.com.conf file looks like:

Here's what my hosts file looks like:

This is all just on a local dev box where I want to have multiple sites located under /var/www. Once the site is developed, I'm going to move them to my hosting company. I currently don't have other IP addresses to add, so I skipped the step of adding VPS server IPs.

I am able to successfully run the

sudo a2ensite webtest.com.conf

command and I restart apache.

But when I go to my site by typing , I get a 404 not found error.

What I've tried so far: - I've reviewed the article to make sure I didn't miss any steps. - proved that apache itself is working by going to When I do that, I get a page that reads:

Then I stop the apache service and try the same URL. It fails.

asked Jul 29, 2014 at 1:50

user avatar
dotdot

13.6k3737 gold badges9393 silver badges185185 bronze badges

Did you know that Apache web server allows you to configure custom 404 error page for your website? Using ErrorDocument directive you can easily configure custom error page in Apache, without any coding. In this article, we will look at how to create custom 404 page in Apache. You can also use these steps to configure custom error pages for other error codes such as 403, 500, 502, etc.

How To Create Custom 404 Page in Apache

Here are the steps to configure custom 404 error page for your website. We will use the ErrorDocument directive to setup custom 404 page. Please make sure that you have your error page file ready, before you proceed further. We have assumed that our error file error404.html is located at website root folder /var/www/html/.

You can add ErrorDocument directive in .htaccess file, virtual host configuration file or your main server configuration file, as per your requirement.

1. Open .htaccess file

You will typically find .htaccess file in your site’s root folder (e.g /var/www/html/). You can open it using vi editor

$ sudo vim /var/www/html/.htaccess

If you have not setup .htaccess but have setup virtual hosts, then you can also open your virtual host configuration file (e.g /etc/apache2/sites-enabled/example.com for your domain example.com)

$ sudo vim /etc/apache2/sites-enabled/example.com

Alternatively, you can also open the default virtual host configuration file

$ sudo vim /etc/apache2/sites-enabled/000-default.com

Also read : How to Create Self-Signed Certificate for Apache

2. Configure 404 Error Page

Add the following line to .htaccess file

ErrorDocument 404 /error404.html

In the above line, we specify the error response code 404 and the custom page error404.html to be served for it. You can also configure error pages for other response codes such as 500, 502, 403, etc.

If you are using Virtual host file, add the above line inside VirtualHost tag

<VirtualHost> ... ErrorDocument 404 /error404.html ... </VirtualHost>

Also read : How to Use Apache bench for Load Testing

3. Create 404 Error page

Create custom error file error404.html using text editor, or a page builder like Squarespace, WordPress, or Wix.

4. Restart Apache Server

Restart Apache Server to apply changes

$ sudo service apache2 restart

Hopefully, this article will help you create custom 404 pages for your website. You can use these steps to configure custom pages for other error codes such as 500, 502, 403, etc.

Ubiq makes it easy to visualize data, and monitor them in real-time dashboards. Try Ubiq for free.

mm

About Ubiq

Ubiq is a powerful dashboard & reporting platform for small & medium businesses. Build dashboards, charts & reports for your business in minutes. Get insights from data quickly. Try it for free today!

Apachecustom 404 page. permalink.

How to Configure a Custom 404 Error Page — Apache Server Edition

A 404 File Not Found page — also known as a 404 error page — is a web page that lets a user know when the page they are trying to access cannot be located. A custom 404 error page is a 404 error page that is crafted thoughtfully with user experience in mind. Custom 404 error pages are put into place to fend off confusion, explain the situation, and offer thoughtful next steps that keep the ball rolling.

To get a custom 404 error page up and running on your website, you’ll need to do some communicating with your server.

404-error_PaulYokota

How you go about getting a custom 404 error page setup on your server will vary greatly depending on your server type. This article addresses how to set up a custom 404 error page on an Apache server.  

Getting a custom 404 error page up and running on the Apache Server is a five-part process:

  1. Design an on-brand custom 404 error page.
  2. Publish your custom 404 error page.
  3. Determine what type of server you are using, or if you are using a CMS like WordPress.
  4. Use your public_html folder and .htaccess file to tell your server to deliver the 404 error page anytime a request is made for a web page that doesn’t exist.
  5. Test it! Make sure your 404 error page is live and working as expected.

In this post we cover parts 3, 4 and 5 of this process; you should already have parts 1 and 2 done. If you haven’t designed your custom 404 error page yet, read How to Design a 404 Error Page That Saves a Sale for strategic inspiration.

How to Determine Your Server Type

Your website is hosted on a server that dishes out web pages when people navigate to URLs within your domain. There are several types of servers.

server-illustration-Apache_2First, the easiest one: If you are using WordPress, then you know you’re using WordPress and you should read about WordPress 404 error page setup; this Apache server article will not help you. Similarly, if you happen to be using Microsoft IIS, then you should read our How to Configure a Custom 404 Error Page in Microsoft IIS Server post.

If you aren’t using WordPress and you don’t know what kind of server you are using, call your server provider (the people you pay to host your website every month – like BlueHost, for instance), and ask them. While you have them on the line, make sure to also ask them if it is possible to set up a custom 404 error page; most server providers allow you to do this, but not all.

If your server provider tells you your website is hosted on the most widely used Web server — the Apache server — then read on!

Proceed with Caution!

If you are reading this blog post, I am assuming that you don’t have the luxury of asking an IT department to set your custom 404 error page up for you. If you do have an IT/systems department to refer to, by all means, ask for help! IT folks love servers and lines of code that talk to servers, and they effectively know how to handle both.

If you’re going in on your own, it’s smart to make sure you have your entire website backed up before you make any changes to code at the server level. The amendments we’ll be making to add a custom 404 error page are minimal, but it’s always better to be safe than sorry when it comes to tinkering with server-side code.

How to Tell Your Server to Deliver the 404 Error Page

This blog post is written to help folks using the Apache server add a custom 404 error page to their website. Like most processes, there’s inherently server-illustration-3more than one way to do this. The following five-step process is the most universal method, as it only requires FTP access to your server and a text editor, like Notepad++ (on a PC) or TextEdit (on a Mac). (It’s worth mentioning here that Notepad [the default text editor in Windows] and Notepad++ are not the same thing. If you’re using a PC, we recommend downloading the free Notepad++ text editor; using the standard release version of Notepad may cause errors if the server is running Linux.)

Step 1: Locate or create your .htaccess file

After identifying that you are using the Apache server, the first step is to locate your .htaccess file.

A .htaccess file is a file that communicates how and when your server should deliver specific information to your end user. In this case, specifically, when your server should deliver a fancy, custom-made 404 error page. Your .htaccess file should already be in the root directory of your website.

To access your .htaccess file:

  • Connect to your server using an FTP editor like CyberDuck or Filezilla.
  • Find the folder that contains your public website files. Public_html is a common name for this folder. While your folder may or may not be named public_html, we will refer to this folder as the public_html folder throughout the rest of this tutorial.
  • Locate the .htaccess file inside the public_html folder.

If you see a .htaccess file, move on to step three.

cyberduck-publichtml-htaccess_private2

If you don’t see a .htaccess file, make sure that your FTP is set to show hidden files (notice that period in front of the .htaccess file? That period means your .htaccess file it is a hidden file.). To show hidden files using Cyberduck, go to the View dropdown, then choose Show Hidden Files. To show hidden files using Filezilla, go to the Server dropdown, then choose Force Showing Hidden Files.

Cyberduck-show-hidden-files

If you force your FTP to show hidden files and you still don’t see a .htaccess file, it means you don’t have one and you will have to make one. In that case, move on to step two.

Step 2: Create your .htaccess file (if you don’t already have one)

Fair warning: While any novice can create a .htaccess file (we’re going to show you how right here!), if you have an IT department this is a really, really good time to bring them in the loop. If you don’t have an IT department, now would be a great time to create that website backup if you haven’t already!  Your .htaccess file is going to communicate critical information to every page of your website, so it’s smart to have a backup plan in case things get a little haywire.

To create an .htaccess file, use a text editor like Notepad++ on a PC, or TextEdit on a Mac. Name the file .htaccess — and don’t forget the “.” It needs to be named .htaccess (periodhtaccess), not just htaccess. To keep your .htaccess file clean, make sure your text editor has word wrap disabled, and that it is using UNIX-style line endings. Also, make sure there aren’t any file extensions added to your .htaccess file when you save it. You want to choose All Files (not Text or any other file type) from the Save As Type dropdown menu and save to the Desktop.

Save-htaccess-file-as-ALL-TYPES_2

That’s it! After you save you’re done creating your .htaccess file. The file won’t do anything until you’ve uploaded it to the public_html folder of your server via FTP but, to streamline the process, we’ll wait until after we amend the file (as outlined in step three) to upload it to the server.

Step 3: Use a text editor to edit the .htaccess file

Using your text editor, add this one line of code to your .htaccess file, followed by a blank line:

ErrorDocument 404 /custom-404.html

There’s four parts to this line of code: [the phrase ErrorDocument] [the error number] [the absolute URL of the web page where custom 404 content lives] [the blank line that follows the line of code]. Make sure you carefully include all four elements (No typos! No exclusions!) and make sure you replace the placeholder “custom-404.html” with the actual URL extension where your custom 404 error page lives.

The URL that you put in the ErrorDocument directive needs to be a:

1. Relative URL — no http and no domain name.

2. Static file — meaning Apache can serve it directly (no proxy, no application server, etc.); otherwise, Apache will assume the file is on another server and issue a redirect to the browser to go there.

It’s this one line of code that tells your .htaccess file to deliver a custom 404 page when someone asks for a web page that cannot be located.

Step 4: Use FTP to upload your amended .htaccess file to your server

Make your .htaccess file alliiivvvveeee (like Frankenstein) by using your FTP to upload your amended file to your server.

Once it’s uploaded to the root directory of your server, it’s live and your 404 error page should be working (assuming you’ve made your 404 error URL live, as well).

Step 5: Test it! Make sure your 404 error page is working

The final step in every optimization process needs to be testing. We never set it and forget it in our industry. To test if everything is in working order testtubeswith your .htaccess file and your new custom 404 error page, use your web browser to navigate to a page on your website that you know doesn’t exist. For example: www.YourWebsite.com/chelsea-is-awesome.

If you see your custom 404 error page, everything is working! You have succeeded!

If you don’t see your custom 404 error page, something is wrong. Try to isolate the problem with these troubleshooting tips:

  • Do all the other pages on your website work? If yes, that means the problem has to be with your 404 error page URL or your .htaccess file. If no, you have created a bigger issue and may want to revert back to a backup version of your .htaccess file.
  • Can you spot any typos in your ErrorDocument line of code?
  • Did you add a blank line after your ErrorDocument line of code?
  • Did you disable word wrap when you created your .htaccess file? Is your ErrorDocument code on one single line? If you are using Windows, is the document using UNIX-style line endings?
  • Is your .htaccess file saved as .htaccess.txt? It shouldn’t be. It should just be .htaccess with no file extension. (The trick is to choose All Files from the Save as Type dropdown when you save the file in your text editor; make sure no extra file extensions get added on.)
  • If you navigate directly to your 404 error page using the absolute URL, does it work?

If none of these troubleshooting tips uncover your problem… now might be a good time to seriously consider hiring that contract IT guy or gal.

You Can Do This!

Even if you are a UX minimalist — no matter how big or small your company is — you need to consider a properly configured 404 error page a technical SEO essential. You absolutely can do all the steps outlined in this post, from locating your hidden .htaccess file or creating a new one, to writing a line of code that works. Think of it like baking a cake: you have the recipe, now you just need to put all the ingredients together.

Just follow this five-step process:

1. Get confirmation that you’re using the Apache server and the thumbs up to proceed with a custom 404 from your server host.

2. Work with your web designer to create a custom 404 error page.

3. Make your 404 error page live.

4. Use your public_html folder and .htaccess file to tell your server to deliver the 404 error page anytime a request is made for a web page that doesn’t exist.

5. Test, test, test.

Have questions? Ask in the comments section below.

 

Next Steps_600x203

Chelsea Adams Brooks is a long-distance cyclist, aspiring cob house builder, schema/analytics/algorithm obsessor, and a former senior content writer at Bruce Clay Inc.

See Chelsea's author page for links to connect on social media.

Posted by Chelsea Adams on March 18th, 2015 at 10:30 am

Filed under: Web Design —

7 Replies to “How to Configure a Custom 404 Error Page — Apache Server Edition”

We had an interesting security report for our Oh Dear monitoring service. An attacker could load a specific URL and trigger a 404 page in which they controlled the output.

What content spoofing in a 404 page looks like

The URL looked like this.

If you decode that, you can see that the is a specially encoded path separator. The URL decoded version looks like this.

You’d think Apache handles that OK by default, but it doesn’t. We have a custom 404 error page, but the URL above triggered this one.

404 content spoofing error page

What’s worrying here is that the attacker controls the text on the page, because the default 404 confirms the page URL right in the HTML body.

And since many browsers decide on hiding the URL in the address bar and just show the domain name instead, it isn’t immediately obvious the URL has been tampered with.

Preventing content spoofing in Apache’s 404 error page

Chances are, your website is vulnerable to this too. Copy/paste the URL above and see what kind of error page you get.

The fix is to apply a little-known Apache config called AllowEncodedSlashes and set it to .

There appears to be a bug in Apache that requires you to set this in every VirtualHost because globally defined configs aren’t inherited to VirtualHosts.

In other words: copy this to every every VirtualHost you have.

After you add that config and reload the Apache daemon, you’ll be served either your custom 404 page (the one you were expecting) or a cleaned up 404 page of Apache.

404 content spoofing error page

It surprises me this is isn’t a default config in Apache though.

Table of contents

Apache Error code 404 means “file not found”. This is the error code when a user requested a web page or file which does not exist on the server. As per the SEO perspective, it’s not good to return a 404 error code to the user even requested file doesn’t exist.

Now, You can either configure a custom 404 error page on your server or redirect the website to the home page. In this tutorial, we will help you to create a custom 404 error page for your Apache server.

Create A Custom 404 Error Page

First of all, create a 404 file on your server. You can create this file under the document root of your application. For example, I have created a file named custom_404.html under the document root with the following content.

<html>

<head>

<title>Error 404</title>

</head>

<body>

<div class="container">

<h1>404</h1>

<h2>Page Not Found</h2>

<p>The Page you are looking for doesn't exist or moved to other location. Go to <a href="">Home Page.</a></p>

</div>

</body>

</html>

Next, create and edit the .htaccess file under the document root of your application and add the following content to the end of the file.

#### Error Documents

ErrorDocument404/custom_404.html

Save the file and close it.

Now, access any file to your domain, which doesn’t exist on the server. You will see the custom error page instead of the default Apache error message on your web browser.

How to Change the Apache Error Messages

← ServerPilot Docs

You can change the Apache error messages for a single app by adding directives to the app's file. For example, any of these formats work:

ErrorDocument 403 "Sorry, access to this page is forbidden." ErrorDocument 500 http://example.com/server_error.html ErrorDocument 503 /errors/service_unavailable.html

The format that uses an or URL will redirect the browser to the specified page.

To change the error pages globally, log in as and create the following file:

/etc/apache-sp/conf.d/errors.conf

In that file, include this content:

ErrorDocument 403 "Sorry, access to this page is forbidden." ErrorDocument 500 http://example.com/server_error.html ErrorDocument 503 "Service Unavailable"

Then, restart Apache by running the following command as :

sudo service apache-sp restart

Note that you should not use the path to a file when configuring this globally.

Changing 404 Error Messages

You can change the messages Apache sends for 404 errors by entering the following line in your app's file:

ErrorDocument 404 /404.php

This format assumes you have a file called in your app's directory.

However, this ErrorDocument directive will not catch 404 errors for requests that end in themselves. For example, a request for will not be handled by the ErrorDocument directive because the request ends in .

To handle 404 errors for requests that end in , you should use rewrite rules that direct those requests to a specific PHP script, which will then send a 404 response.

To show a custom 404 page (using a file named , for example) when a requested script doesn't exist, add the following to your app's file:

RewriteRule ^404\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /404.php [L]

Then, in that script, you would have something like this:

<?php header("HTTP/1.0 404 Not Found"); // generate the HTML of the response here ?>
NectarSpot Marketing, Automation, and Design Company, 50 S Main St #200, Naperville, IL 60540

⭐⭐⭐⭐⭐
NectarSpot developed our website, logo and helped us with the content. They also manage are SEO and social marketing. They do a great job, we highly recommend NectarSpot!
Sachin Gandhi a year ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot Inc team continuously worked to make our site smartercurcumin load faster from earlier 8+ secs to 0.7 sec (speed index score) as per Google's Page Speed. The NectarSpot team combined disparate and large CSS code to single CSS file, optimized images in a new format, and added script for the lazy load of images (pixels) and javascript codes. We are pleased with the outcome as the average page load time has reduced drastically resulting in better user experience, which directly contributed to higher revenues.
Trevor Sellman a year ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot is a true partner. The team at NectarSpot is passionate everything about digital transformation and truly understand our RENEW brand as well as we do. After we approached them to audit our marketing initiatives, they helped us to redesign and replatform our medical wellness clinic's web and mobile application after seamlessly taking over from another company. After completing rebranding exercise in a record time, they are helping us in lead generation and conversion optimization by using Google Ads, Google Analytics and Google Optimize tools. We are looking forward to working with them in future expansion plans as well. We do trust them as a true partner in our growth story.
Waleed Mansor a year ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot has been very punctual with designing and meeting our demands. Not only have they designed an amazing website for our company but they have given us tools and resources that make our day to day tasks much more efficient and convenient. They have taught us many features in a rapidly changing field of technology. Our customers rave about our website functionality and the ease of access.
Vasu Pandey 2 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
Our team at Chicago Buzz Marketing has collaborated on digital marketing campaigns with NectarSpot since 2019. Rakesh and team offer creative, technology focused solutions at a price point the small business community can actually afford. A great option for firms looking to partner, and small business leaders looking for a team to manage web needs and updates.
Tea With the Bee 2 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
For our brand new HopperStand product, we wanted a cool-looking, fast-loading website. I am happy to have found NectarSpot as the company to deliver to our specific needs. Their team worked with us closely following a pre-defined plan and executed the project flawlessly and efficiently! We would highly recommend NectarSpot for their professionalism, attention to detail, and desire to see our project succeed using the latest in web design technologies - in our case, AMP (Accelerated Mobile Pages) framework. In addition, we are working with them on marketing projects related to lead generation on social media and paid search channels. We can confidently say that we can count on them to consistently deliver us results and exceed all expectations.
Santosh Arcot 3 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot team helped us from the beginning of our company's journey, including strategizing our company's name and developing & optimizing our website per our requirements. The custom web application built by the NectarSpot team was efficient and effective. The team also helped us to generate qualified leads by creating a media plan for our business and run campaigns on Google Ad Network. We would recommend them to build complex and custom web applications.
Eugene Yoo 3 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot team made the process of planning, designing and developing our website very easy. The final outcome is a very responsive, branded website with a modern layout and a better user experience. The team at NectarSpot has an excellent eye for design plus attention to details and we are proud of the outcome! Thank you NectarSpot for your “top notch”work.
Daiva Shimk 4 years ago
Google Icon

Posted On Google


getting 404 not found - website with apache2 on ubuntu

Background:

I've installed apache2 and have tried set up virtual directories. but when I try apache2 404 error page test the different sites, I keep getting 404 error messages.

The article /tutorial I've been following is located at: https://www.digitalocean.com/community/tutorials/how-to-configure-the-apache-web-server-on-an-ubuntu-or-debian-vps

I have the following folder structure in place:

In the /etc/apache2/sites-available folder, I have the following configuration files:

Here's what the webtest.com.conf file looks like:

Here's what my hosts file looks like:

This is all just on a local dev box where I want to have multiple sites located under /var/www. Once the site is developed, I'm going to move them to my hosting company. I currently don't have other IP addresses to add, so I skipped the step of adding VPS server IPs.

I am able to successfully run the

sudo a2ensite webtest.com.conf

command error getting send status of message gammu I restart apache.

But when I go to my site by typingI get a 404 not found error.

What I've tried so far: - I've reviewed the article to make sure I didn't miss any steps, apache2 404 error page. - proved that apache itself is working by going to When I do that, I get a page that reads:

Then I stop the apache service and try the same URL. It fails.

asked Jul 29, 2014 at 1:50

user avatar
dotdot

13.6k3737 gold badges9393 silver badges185185 bronze badges

Apache Error code 404 means “file not found”. This is the error code when a user requested a web page or file which does not exist on the server. As per the SEO perspective, it’s not good to return a 404 error code to the user even requested file doesn’t exist.

Now, You can either configure a custom 404 error page on your server or redirect the website to the home page. In this tutorial, we will help you to create a custom 404 error page for your Apache server.

Create A Custom 404 Error Page

First of all, create a 404 file on your server. You can create this file under the document root of your application. For example, I have created a file named custom_404.html under the document root with the following content.

<html>

<head>

<title>Error 404</title>

</head>

<body>

<div class="container">

<h1>404</h1>

<h2>Page Not Found</h2>

<p>The Page you are looking for doesn't exist or moved to other location. Go to <a href="">Home Page.</a></p>

</div>

</body>

</html>

Next, create and edit the .htaccess file under the document root of your application and add the following content to the end of the file.

#### Error Documents

ErrorDocument404/custom_404.html

Save the file and close it.

Now, access any file to your domain, which doesn’t exist on the server. You will see the custom error page instead of the default Apache error message on your web browser.

NectarSpot Marketing, Automation, and Design Company, 50 S Main St #200, apache2 404 error page, Naperville, IL 60540

⭐⭐⭐⭐⭐
NectarSpot developed our website, logo and helped us with the content. They also manage are SEO and social marketing. They do a great job, we highly recommend NectarSpot!
Sachin Gandhi a year ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot Inc team continuously worked to make our site smartercurcumin load faster from earlier 8+ secs to 0.7 sec (speed index score) as per Google's Page Speed. The NectarSpot team combined disparate and large CSS code to single CSS file, optimized images in a new format, and added script for the lazy load of images (pixels) and javascript codes. We are pleased with the outcome as the average page load time has reduced drastically resulting in better user experience, which directly contributed to higher revenues.
Trevor Sellman a year ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot is a true partner. The team at NectarSpot is passionate everything about digital transformation and truly understand our RENEW brand as well as we do. After we approached them to audit our marketing initiatives, they helped us to redesign and replatform our medical wellness clinic's web and mobile application after seamlessly taking over from another company. After completing apache2 404 error page exercise in a record time, they are helping us in lead generation and conversion optimization by using Google Ads, Google Analytics and Google Optimize tools. We are looking forward to working with them in future expansion plans as well. We do trust them as a true partner in our growth story.
Waleed Mansor a year ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot has been very punctual with designing and meeting our demands, apache2 404 error page. Not only have they designed an amazing website for our company but they have given us tools and resources that make our day to day tasks much more efficient and convenient. They have taught us many features in a rapidly changing field of technology. Our customers rave about our website functionality and the ease of access.
Vasu Pandey 2 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
Our team at Chicago Buzz Marketing has collaborated on digital marketing campaigns disc read error occurred xp NectarSpot since 2019. Rakesh and team offer creative, technology focused solutions at a price point the small business community can actually afford. A great option for firms looking to partner, and small business leaders looking for a team to manage web needs and updates.
Tea With the Bee 2 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
For our brand new HopperStand product, we wanted a cool-looking, fast-loading website. I am happy to have found NectarSpot as the company to deliver error typecheck offendingcommand makefont our specific needs. Their team worked with us closely following a pre-defined plan and executed the project flawlessly and efficiently! We would highly recommend NectarSpot for their professionalism, attention to detail, and desire to see our project succeed using the latest in web design technologies - in our case, AMP (Accelerated Mobile Pages) framework. In addition, apache2 404 error page, we are working with them on marketing projects related to lead generation on social media and paid search channels. We can confidently say that we can count on them to consistently deliver us results and exceed all expectations.
Santosh Arcot 3 years ago
Google Icon

Posted On Google


⭐⭐⭐⭐⭐
NectarSpot team helped us from the beginning of our company's journey, including strategizing our company's name and developing & optimizing our website per our requirements. The custom web application built by the NectarSpot team was efficient and effective. The team also helped us to generate qualified leads by creating a media plan for our business and run campaigns on Google Ad Network. We would recommend them to build complex and apache2 404 error page web applications.
Eugene Yoo 3 years ago apache2 404 error page src="https://nectarspot.com/images/google-icon.svg" alt="Google Al.alligator 2008 - windows vista error vol.2 On Google


⭐⭐⭐⭐⭐
NectarSpot team made the process of planning, designing and developing our website very easy. The final outcome is a very responsive, branded website with a modern layout and a better user experience. The team at NectarSpot has an excellent eye for design plus attention to details and we are proud of the outcome! Thank you NectarSpot for your “top notch”work.
Daiva Shimk 4 years ago
Google Icon

Posted On Google


Learn how to set up google /usr/bin/dpkg returned an error code 1 error pages in Apache, apache2 404 error page. The Apache web server provides a default set of generic error pages for 404, 500, and other common Apache errors.

However, creating custom error pages allows you to:

  • Continue your branding on these pages
  • Integrate their design into the look and feel of your website
  • Direct lost visitors to their intended destinations
  • Provide error pages in languages other than English

Requirements

  • Cloud Server running Linux (CentOS 7 or Ubuntu 14.04)
  • Apache installed and running

vServer (VPS) from IONOS

Low-cost, powerful VPS hosting for running your custom applications, with a personal assistant and 24/7 support.

100 % SSD storage
Ready in 55 sec.
SSL certificate

Create the custom error page

First, you will need to create the custom error page. For testing purposes, we will create an example error page to handle 404 errors.

Use SSH to connect to your server and go to your website's document root. Create a new page named my-404.html with the command:

Put the following into this file:

Save and exit the file.

You can view the file by going to "http://example.com/my-404.html" to make sure it is displaying correctly.

Configure Apache to use the custom error page

To tell Apache to use a custom error page, you will need to add an ErrorDocument directive. The syntax for this directive is:

For this example, since the my-404.html file is in the site's document root, we will be adding the directive:

This directive needs to go inside the VirtualHost command block in the site's main Apache configuration file.

By common convention, this Apache configuration file is usually:

  • CentOS 7/etc/httpd/conf.d/example.com.conf
  • Ubuntu 14.04/etc/apache2/sites-available/example.com.conf

Note

The location and filename of a site's Apache configuration file can vary based on how you or your server administrator has set up hosting.

Edit this file with your editor of choice, for example with the command:

  • CentOS 7sudo nano /etc/httpd/conf.d/example.com.conf
  • Ubuntu 14.04sudo nano /etc/apache2/sites-available/example.com.conf

Scroll through the file until you find the VirtualHost command block, which will look like:

Add the ErrorDocument to the VirtualHost command block, apache2 404 error page, but be sure to put it outside any Directory command blocks, apache2 404 error page. For example:

Save and exit the file, then restart Apache for the changes to take effect:

  • CentOS 7sudo systemctl restart httpd
  • Ubuntu 14.04sudo services apache2 restart

Finally, test your error document by going to an invalid URL for your website. You will be redirected to your new custom 404 page instead.

Other HTTP error codes

The most common custom error page is for a 404 error. However, you may want to create custom error pages for other Apache errors as well.

These pages can be configured for any 4xx or 5xx error code. A full list of these HTTP error codes can be found on Wikipedia.

Related articles

Install and Use Apache Tomcat on CentOS 7

Learn how to install and use Apache Tomcat on CentOS 7. Apache Tomcat is a Java Servlet container developed by Apache to system error code 14001 which allows you to deploy Java servlets and JSPs. Apache Tomcat also functions as a web server, which is able to support small to medium-sized websites. This tutorial also apache2 404 error page how to install and use the Tomcat Web Admin Manager, which allows you to manage Tomcat and virtual., apache2 404 error page.

Enable CGI Scripts on Apache

Learn how to enable CGI scripts to run on the Apache web server. This tutorial includes step-by-step instructions for adding the necessary Apache configurations to allow CGI scripts to run, and how to set the correct permissions on the directory and CGI files.

Use the ModSecurity Apache Module on a Cloud Server with Ubuntu 16.04

ModSecurity is a free web application firewall (WAF) which is a simple, powerful way to protect a server against web-based malware and hacking attempts. Learn how to install ModSecurity and the officially-recommended OWASP Core Rule Set (CRS) which will protect a server against malware and hacking in the form of SQL injection, session hijacking, cross-site scripting, Trojans, and many other forms.

Add and Manage Virtual Hosts on a Plesk Server

Learn how to add and manage domains as virtual hosts on a Cloud Server with Plesk. Virtual hosts allow you to host multiple separate websites on the same server, with a separate set of directories for each website.

How to Change the Apache Error Messages

← ServerPilot Docs

You can change the Apache error messages for a single app undefined reference std cout error adding directives to the app's file. For example, any of these formats work:

ErrorDocument 403 "Sorry, access to this page is forbidden." ErrorDocument 500 http://example.com/server_error.html ErrorDocument 503 /errors/service_unavailable.html

The format that uses an or URL will redirect the browser to the specified page.

To change the error pages globally, log in as and create the following file:

/etc/apache-sp/conf.d/errors.conf

In that file, include this content:

ErrorDocument 403 "Sorry, access to this page is forbidden." ErrorDocument 500 http://example.com/server_error.html ErrorDocument 503 "Service Unavailable"

Then, restart Apache by running the following command as :

sudo service apache-sp restart

Note that you should not use the path to a file windows error code 1275 configuring this globally.

Changing 404 Error Messages

You can change the messages Apache sends for 404 errors by entering the following line in your app's file:

ErrorDocument 404 /404.php

This format assumes you have a file called in your app's directory.

However, this ErrorDocument directive will not catch 404 errors for requests that end in themselves. For example, a request for will not be handled by the ErrorDocument directive because the request ends in .

To handle 404 errors for requests that end inyou should use rewrite rules that direct those requests to a specific PHP script, which will then send a 404 response.

To show a custom 404 page (using a file namedfor example) when a requested script doesn't exist, add the following to your app's file:

RewriteRule ^404\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule. /404.php [L]

Then, in that script, you would have something like this:

<?php header("HTTP/1.0 404 Not Found"); // generate the HTML of the response here ?>

We had an interesting security report for our Oh Dear monitoring service. An attacker could load a specific URL and trigger a 404 page in which they controlled the output.

What content spoofing in a 404 page looks like

The URL looked like this.

If you decode that, apache2 404 error page, you can see that the is a specially encoded path separator. The URL decoded version looks like this.

You’d think Apache handles that OK by default, but it doesn’t. We have a custom 404 error page, but the URL above triggered this one.

404 content spoofing error page

What’s worrying here is that the attacker controls the text on the page, because the default 404 confirms the page URL right in the HTML body.

And since many browsers decide on hiding the URL in apache2 404 error page address bar and just show the domain name instead, it isn’t immediately obvious the URL has been tampered with.

Preventing content spoofing in Apache’s 404 error page

Chances are, your website is vulnerable to this too. Copy/paste the URL above and see what kind of error page you get.

The fix is to apply a little-known Apache config called AllowEncodedSlashes and set it to .

There appears to be a bug in Apache that requires you to set this in every VirtualHost because globally defined configs aren’t inherited to VirtualHosts.

In other words: copy this to every every VirtualHost you have.

After you add that config and reload the Apache daemon, you’ll be served either your custom 404 page (the one you were expecting) or a cleaned up 404 page of Apache.

404 content spoofing error page

It surprises me this is isn’t a default config in Apache though.

Table of contents

Did you know that Apache web server allows you to configure custom 404 error page for your website? Using ErrorDocument directive you can easily configure custom error page in Apache, without any coding. In this article, we will look at how to create custom 404 page in Apache. You can also use these steps to configure custom error pages for other error codes such as 403, 500, 502, etc.

How To Create Custom 404 Page in Apache

Here are the steps to configure custom 404 error page for your website. We will use the ErrorDocument directive to setup custom 404 page. Please make sure that you have your error page file ready, before you proceed further. We have assumed that our error file error404.html is located at website root folder /var/www/html/.

You can add ErrorDocument directive apache2 404 error page .htaccess file, virtual host configuration file or your main server configuration file, as per your requirement.

1. Open .htaccess file

You will typically find .htaccess file in your site’s root folder (e.g /var/www/html/). You can open it using vi editor

$ sudo error c4430 c /var/www/html/.htaccess

If you have not setup .htaccess but have setup virtual hosts, then you can also open your virtual host configuration file (e.g /etc/apache2/sites-enabled/example.com for your domain apache2 404 error page sudo vim /etc/apache2/sites-enabled/example.com

Alternatively, you can also open the default virtual host configuration file

$ sudo vim /etc/apache2/sites-enabled/000-default.com

Also read : How to Create Self-Signed Certificate for Apache

2. Configure 404 Error Page

Add the following line to .htaccess file

ErrorDocument 404 /error404.html

In the above line, we specify the error response code 404 and the custom page error404.html to be served for it. You can also configure error pages for other response codes such as 500, 502, 403, etc.

If you are using Virtual host file, add the above line inside VirtualHost tag

<VirtualHost> . ErrorDocument 404 /error404.html . </VirtualHost>

Also read : How to Use Apache bench for Load Testing

3, apache2 404 error page. Create 404 Error page

Create custom error file error404.html using text editor, or a page builder like Squarespace, WordPress, or Wix.

4. Restart Apache Server

Restart Apache Server to apply changes

$ sudo service apache2 restart

Hopefully, this article will help you create custom 404 pages for your website. You can use these steps to configure custom pages for other apache2 404 error page codes such as 500, 502, 403, etc.

Ubiq makes it apache2 404 error page to visualize data, and monitor them in real-time dashboards. Try Ubiq for free.

mm

About Ubiq

Ubiq is a powerful dashboard & reporting platform for small & medium businesses. Build dashboards, charts & reports for your business in minutes. Get insights from data quickly. Try it for free today!

Apachecustom 404 page. permalink.

Something: Apache2 404 error page

ERROR UNRESOLVED EXTERNAL FT_OPEN REFERENCED FROM
Apache2 404 error page
Apache2 404 error page

watch the video

Turn your Apache directory index and 404 error page from drab to fab!