logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: changing Error page ?
Author
Ang3lus



Joined: 02 Aug 2010
Posts: 18

PostPosted: Thu 23 Sep '10 7:30    Post subject: changing Error page ? Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 23 Sep '10 9:59    Post subject: Reply with quote

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

PostPosted: Thu 23 Sep '10 18:26    Post subject: Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 23 Sep '10 23:26    Post subject: Reply with quote

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

PostPosted: Fri 24 Sep '10 17:18    Post subject: Re: changing Error page ? Reply with quote

@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

PostPosted: Fri 24 Sep '10 20:16    Post subject: Reply with quote

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

PostPosted: Sat 25 Sep '10 15:58    Post subject: Reply with quote

Any new Suggestion would be appreciated

thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Sat 25 Sep '10 16:16    Post subject: Reply with quote

Your Syntax is wrong Wink

ErrorDocument would be correct not DocumentError
Back to top
Ang3lus



Joined: 02 Aug 2010
Posts: 18

PostPosted: Sat 25 Sep '10 18:43    Post subject: Reply with quote

i correct it now Embarassed

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Sat 25 Sep '10 20:04    Post subject: Reply with quote

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

PostPosted: Mon 27 Sep '10 5:38    Post subject: Reply with quote

thanks for your help

it seems that * made many problems. i delete it then i changed order of access and every things work well.

Mr. Green Very Happy
Back to top


Reply to topic   Topic: changing Error page ? View previous topic :: View next topic
Post new topic   Forum Index -> Apache