The Little Guy Posted October 1, 2008 Share Posted October 1, 2008 I am making error documents, they are stored in a folder called "error" so to access this error file from the address bar would look like this: http://site.com/error/500.html I have all these methods, and none work: ErrorDocument 500 /error/500.html ErrorDocument 500 error/500.html ErrorDocument 500 http://site.com/error/500.html The first way just displays my server's default 500 page. The second way displays "error/500.html". The third way just redirects the browser to the error page. How can I get it to display the error page? Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/ Share on other sites More sharing options...
corbin Posted October 2, 2008 Share Posted October 2, 2008 Try: ErrorDocument 500 /error/500.html Rule of thumb is to always use absolute paths (in this context meaning absolute web root paths, if ya know what I mean) with error documents. Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-655364 Share on other sites More sharing options...
The Little Guy Posted October 3, 2008 Author Share Posted October 3, 2008 Remember above I said I did that, and it just displayed the default error page. Unless there is a difference I am not seeing... Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-656180 Share on other sites More sharing options...
The Little Guy Posted October 7, 2008 Author Share Posted October 7, 2008 Both of these work: ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html Why doesn't this: ErrorDocument 500 /error/500.html Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-659464 Share on other sites More sharing options...
corbin Posted October 8, 2008 Share Posted October 8, 2008 Try a different folder and see if it works. I have a hunch that the /error/ folder may be an alias and the 500.html file already exists. Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-659579 Share on other sites More sharing options...
The Little Guy Posted October 9, 2008 Author Share Posted October 9, 2008 I guess I am getting this too: Wed Oct 08 01:59:11 2008] [error] [client 66.249.73.90] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary. [Wed Oct 08 01:59:11 2008] [error] [client 66.249.73.90] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. From this: RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /$1.php [L,QSA] If I comment that out, then it takes me to a 404 page (what I wanted to get instead of the 500 error) Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-660700 Share on other sites More sharing options...
corbin Posted October 10, 2008 Share Posted October 10, 2008 RewriteRule ^(.+)$ /$1.php [L,QSA] That will match anything. That will be ran until it doesn't match any more, and the times after the first time it is run, the rewrite conds are ignored. Is there an exact thing you're trying to match? If so, you could just rewrite the rewrite. Otherwise, you'll have to get creative/complex with the rewrite so you won't get a loop. Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-661529 Share on other sites More sharing options...
The Little Guy Posted October 10, 2008 Author Share Posted October 10, 2008 I just want to match php files, and remove the extension. Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-661908 Share on other sites More sharing options...
corbin Posted October 12, 2008 Share Posted October 12, 2008 So you're matching *.php and redirecting it to *.php? Quote Link to comment https://forums.phpfreaks.com/topic/126667-errordocument/#findComment-663173 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.