Experts Exchange connects you with the people and services you need so you can get back to work.
ErrorDocument 404 /index.html
Open in new window
<?php // 404handler.php
// IF A PHP SCRIPT IS NOT FOUND GO TO THE HOME PAGE
if (preg_match('#\.php#i', $_SERVER["REQUEST_URI"]))
// IF A NON-PHP SCRIPT IS NOT FOUND, TRY IT WITH PHP
$arr = explode('?', $_SERVER["REQUEST_URI"]);
$arr .= '.php';
$uri = implode('?', $arr);
// IF NO REQUEST URI
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.