V
V
vais2014-03-02 13:46:39
Apache HTTP Server
vais, 2014-03-02 13:46:39

.htaccess errordocument

.htaccess is in /var/www/
Probably you shouldn't post everything in it, but here's a piece of interest.
# Bad Rquest
ErrorDocument 400 /400.html
# Authorization Required
ErrorDocument 401 /401.html
# Forbidden
ErrorDocument 403 /403.html
# Not found
ErrorDocument 404 /404.php
# Method Not Allowed
ErrorDocument 405 /405.html
1. if
ErrorDocument 404 /404.php
then
Not Found
The requested URL /sfsdf was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
2. if
ErrorDocument 404 ~/404.php
then when you go to a non-existent page it gives
~/404.php
the following options were also tried
ErrorDocument 404 /error/404.php 1
ErrorDocument 404 ~/error/404.php 2
ErrorDocument 404 /www/error /404.php 1
ErrorDocument 404 /www/404.php 1
ErrorDocument 404 /var/www/error/404.php 1
ErrorDocument 404 http://'server-ip'/error/404.php 1
ErrorDocument 404 http:/ /'server ip'/www/error/ 404.php 1
what could be wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Seva Sargsyan, 2014-03-02
@vais

Is it on a local server or hosted?

S
Stepan, 2014-03-02
@L3n1n

created a new one with one line
ErrorDocument 404 /404.php
works
but ErrorDocument 404 /error/404.php
does not work, but I would like the 2nd option

Try the full path, or ./error/404.php
Look in the configs for what is included: httpd.conf + the file where your virtualhost is registered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question