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? Link to comment https://forums.phpfreaks.com/topic/58610-500-error/ 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']); Link to comment https://forums.phpfreaks.com/topic/58610-500-error/#findComment-290713 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 Link to comment https://forums.phpfreaks.com/topic/58610-500-error/#findComment-290734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.