The Little Guy Posted July 5, 2007 Share Posted July 5, 2007 I have an .htaccess file, that removes ".php" from the url, and if the file doesn't exist, it gives me a 500 Error, so... Is there a way to instead of displaying the 500 error, it just redirects back to the page where the link was clicked? Quote Link to comment Share on other sites More sharing options...
micah1701 Posted July 5, 2007 Share Posted July 5, 2007 i think if you make a custom 500 error page you should be able to just do something like: header("Location: ".$_SERVER['HTTP_REFERER']); Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 5, 2007 Author Share Posted July 5, 2007 I don't know if it is just what Im doing, or this doesn't work: .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php [L,QSA] ErrorDocument 500 errors/500.php php (errors/500.php): <?php header("Location: ".$_SERVER['HTTP_REFERER']); exit; ?> any ways, when I go to the error page, all that happens, is that it writes this to the page: errors/500.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.