Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect 404 error to 404.php page?

Tags:

php

I need help in php. I am making one portal website in Core Php. I had created 404 page and .htaccess file.

404.php:

<html>
  <head>
    <title>404 Error - Page Not Found</title>
  </head>
  <body>404 Error - Page Not Found!</body>
</html>

.htaccess:

Redirect 404 /404.php 

But this is not working. If I use this code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /404.html [L]
</IfModule>

It shows internal server error.

Here is my website: http://jobguide.australianenglishcenter.com/

like image 328
Jaswinder Kaur Avatar asked Oct 09 '15 04:10

Jaswinder Kaur


Video Answer


1 Answers

ErrorDocument 404 http://example.com/404/

add this line to htaccess and change the url

like image 54
ManojGeek Avatar answered Oct 27 '22 13:10

ManojGeek