Author |
|
Ang3lus
Joined: 02 Aug 2010 Posts: 18
|
Posted: Thu 23 Sep '10 7:30 Post subject: changing Error page ? |
|
|
Hi
i want to change error page for example:
if user open secure area and he fails to enter user name and password
the Authorization Required error page will appeared
i would like to change this page to suitable message for each secure directory that user type it on browser.
for example:
the error 401 Authorization Required page for document directory will be different from Authorization Required for user directory
I try to customize 401 many times but i failed to achieve that
the error page appeared same for all directory
i hope i explained well
thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 23 Sep '10 9:59 Post subject: |
|
|
You can use location or directory to change that behaviour.
Code: |
<Location /protected-url/>
ErrorDocument 401 /custom-401.html
</Location>
|
|
|
Back to top |
|
Ang3lus
Joined: 02 Aug 2010 Posts: 18
|
Posted: Thu 23 Sep '10 18:26 Post subject: |
|
|
Thanks for your help
Now it works fine for specific directory but the problem when i use Filesmatch directive and customize error page for it
the other error pages don't work any more. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 23 Sep '10 23:26 Post subject: |
|
|
it might help if you post what you have tried else it is guessing how to help and try to reproduce your problem. |
|
Back to top |
|
Kanashii
Joined: 17 Jul 2006 Posts: 155 Location: Porando
|
Posted: Fri 24 Sep '10 17:18 Post subject: Re: changing Error page ? |
|
|
@some off topic
#for apache do no use error page in PHP script eq error404.PHP, in error_log will be spawn request and will be use some resource
-----
#For 403 forbidden
replace header to 404 and show page content witch 403 for<!-- -->bid<!-- -->den
So if some exploit will be search for page like /phpMyAdmin etc
I went if find will be show like 404 not found so exploit will be not work
Last edited by Kanashii on Sat 03 Nov '12 11:02; edited 2 times in total |
|
Back to top |
|
Ang3lus
Joined: 02 Aug 2010 Posts: 18
|
Posted: Fri 24 Sep '10 20:16 Post subject: |
|
|
here is the code:
<Directory /home/www/user1>
Order Deny,Allow
Deny from all
</Directory>
<FilesMatch "\.(html|php)$">
Order allow,deny
Allow from all
</FilesMatch>
Last edited by Ang3lus on Tue 28 Sep '10 4:14; edited 1 time in total |
|
Back to top |
|
Ang3lus
Joined: 02 Aug 2010 Posts: 18
|
Posted: Sat 25 Sep '10 15:58 Post subject: |
|
|
Any new Suggestion would be appreciated
thanks |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 25 Sep '10 16:16 Post subject: |
|
|
Your Syntax is wrong
ErrorDocument would be correct not DocumentError |
|
Back to top |
|
Ang3lus
Joined: 02 Aug 2010 Posts: 18
|
Posted: Sat 25 Sep '10 18:43 Post subject: |
|
|
i correct it now
but i still have the problem with customize error page
only 403 error page for FilesMatch directive is working |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 25 Sep '10 20:04 Post subject: |
|
|
You can put that Filematch into the directory block, than it will work only in that folder. |
|
Back to top |
|
Ang3lus
Joined: 02 Aug 2010 Posts: 18
|
Posted: Mon 27 Sep '10 5:38 Post subject: |
|
|
thanks for your help
it seems that * made many problems. i delete it then i changed order of access and every things work well.
|
|
Back to top |
|