Web Development Tips and Tricks

Web Development Tips and Tricks

Tuesday, March 15, 2011

How To Do A 404 Redirect With Php?

For this problem we need two file one file .htaccess and one php file i used 404.php you can use any other name.

first Make a .htaccess file

open notepad and paste below code and save as .htaccess page

ErrorDocument 404 http://www/yourdomain/404.php

and 2nd php file

< ? php

echo"page is not found";

?>

You can wrtie anything(use image etc) in php page

now type anypage name which not is your website it will return on 404.php page.

No comments:

Post a Comment