Apache Server configuration support - Directory specific 404

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > October 2006 > Directory specific 404





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Directory specific 404
neil.riddock@gmail.com

2006-10-18, 1:33 pm

I have a website that offers time bound promotions...ie: 10% off all
books, gifts, etc. ... at any one time there might be 2-30 items that
are going to expire. Instead of going through the handful of
directories and changing the pages to say the offer has expired, i
would just like to delete the page and have a 404 page say "Sorry the
offer you seek is expired, please wait while i redirect you....)

The challenge is that i dont want ONE generic 404 saying ("The offer is
expired") ...i would like to have the ability to offer item/directory
specific 404s.

ie:
http://www.site.com/ ----> 404.html ("Fle not found)
http://www.site.com/books/ ----> 404_books.html ("The book offer has
expired...)
http://www.site.com/food/ ----> 404_food.html ("The food offer has
expired...)

Is this possible ... directory specific 404s?

Any help is appreciated. thx.

Jim Hayter

2006-10-18, 1:33 pm

neil.riddock@gmail.com wrote:
> I have a website that offers time bound promotions...ie: 10% off all
> books, gifts, etc. ... at any one time there might be 2-30 items that
> are going to expire. Instead of going through the handful of
> directories and changing the pages to say the offer has expired, i
> would just like to delete the page and have a 404 page say "Sorry the
> offer you seek is expired, please wait while i redirect you....)
>
> The challenge is that i dont want ONE generic 404 saying ("The offer is
> expired") ...i would like to have the ability to offer item/directory
> specific 404s.
>
> ie:
> http://www.site.com/ ----> 404.html ("Fle not found)
> http://www.site.com/books/ ----> 404_books.html ("The book offer has
> expired...)
> http://www.site.com/food/ ----> 404_food.html ("The food offer has
> expired...)
>
> Is this possible ... directory specific 404s?
>
> Any help is appreciated. thx.
>


Read up on the ErrorDocument directive. Note context includes directory.

Syntax: ErrorDocument error-code document
Context: server config, virtual host, directory, .htaccess

HTH,
Jim
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com