How to Force Apache To Show a HTTP-410 Gone Status Code

https://‮l.www‬autturi.com
How to Force Apache To Show a HTTP-410 Gone Status Code

To force Apache to show a HTTP 410 Gone status code for a specific URL or directory, you can use the Redirect directive in the Apache HTTPD configuration file or in a .htaccess file.

The Redirect directive specifies a URL to redirect the client to, and the HTTP status code to use for the redirect. The HTTP 410 Gone status code indicates that the requested resource is no longer available and will not be available in the future.

Here is an example of using the Redirect directive to force Apache to show a HTTP 410 Gone status code for a specific URL:

Redirect gone /old-url/ http://example.com/

This directive will redirect any request for the /old-url/ URL to the http://example.com/ URL using the HTTP 410 Gone status code.

Alternatively, you can use the ErrorDocument directive to specify a custom error page for the HTTP 410 Gone status code, as shown below:

ErrorDocument 410 /error/410.html

This directive will show the /error/410.html page as the error page for the HTTP 410 Gone status code.

Keep in mind that the exact syntax and options for the Redirect and ErrorDocument directives may vary depending on your specific Apache installation and configuration. It is always a good idea to refer to the official Apache documentation for detailed instructions and further information.

Created Time:2017-10-16 14:38:44  Author:lautturi