I've found the solution. I've been using XAMPP for Linux 1.7.1.
- Code: Select all
sudo pico /opt/lampp/etc/extra/httpd-multilang-errordoc.conf
at the end of the file, change the lines as shown i.e. put # to the begginning and add new lines.
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 404 /error403.html
ErrorDocument 404 /error404.html
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
Save and exit (Ctrl+O, CTRL+X)
Prepare custom error files named error403.html and error403.html. These files should be kept in opt/lampp/htdocs directory
It's OK. Just restart XAMPP by below code.
- Code: Select all
sudo /opt/lampp/lampp restart
One more thing, let's think about XAMPP's new security setting of preventing access to XAMPP and phpmyadmin directories rather than the permitted IP addresses. This setting shows error 403 page if you do not connect from permitted IP's. To change this setting also:
- Code: Select all
sudo pico /opt/lammp/etc/extra/httpd-xampp.conf
Thus,
change the line below in /opt/lammp/etc/extra/httpd-xampp.conf
- Code: Select all
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
as
- Code: Select all
ErrorDocument 403 /error404.html
It is not a mistake. Intentionally I recommend you to direct unauthorized visitors requesting to access xampp and phpmyadmin directories to the "page not found" (404) error page. This will be slightly more secure since the attacker may think that there is no xampp or phpmyadmin directory in the server.
I reply my question, i hope this helps.