httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Block" <ht...@collegepublisher.com>
Subject RE: [users@httpd] Please help me with this error document directive
Date Tue, 09 Dec 2003 18:55:30 GMT
Hi Joshua,

Thank you so much for your help. I think you can probably help me solve
this... Let me try to be more clear and lets see if you can figure it out
for me...

For the following example, lets assume that all of the folders up to
http://www.bbtp.com/news/2003/02/06/ exist but the "06" folder is empty.

Here are some URL's that should *not* hit my ErrorDocument directive....

http://www.bbtp.com/news/2003/02/06/ArtsAndEntertainment
http://www.bbtp.com/news/2003/02/06/ding/
http://www.bbtp.com/news/2003/02/06/yay/iofdios.html
http://www.bbtp.com/news/2003/02/06/michaeljackson/iofdios/ifodisfds
http://www.bbtp.com/news/2003/02/06/beatit/iofdios/ifodisfds/iofdiosfds.shtm
l
http://www.bbtp.com/news/2003/02/06/punked/iofdios/ifodisfds/iofdiosfds.jpg

Here are the url's that *should* hit my error handler

http://www.bbtp.com/news/2003/02/06/yay/iofdios.shtml
http://www.bbtp.com/news/2003/02/06/bling/doggy.shtml
http://www.bbtp.com/news/2003/02/06/mickey/mouse.house.yay.for.me.shtml
http://www.bbtp.com/news/2003/02/06/mickey/objects-in-the-mirror-are-closer-
than-they-appear.shtml

Let me know what you think Joshua! Thanks again...

-Jon

-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca]
Sent: Monday, December 08, 2003 12:31 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Please help me with this error document
directive



On Mon, 8 Dec 2003, Jon Block wrote:
> Here is an example of an HTTP GET request I'm making on my Apache
server...
>
>
http://www.bbtp.com/news/2003/02/06/ArtsAndEntertainment/What.I.want.for.my.
> birthday.shtml

> I am trying to figure out how to tell Apache "If you get a request like
> this, serve out "/bling.cfm" instead. However, I only want to serve out
> "/bling.cfm" if the "ArtsAndEntertainment" folder is missing.

> <FilesMatch "X:/news/[0-9]{4}/[0-9]{2}/[0-9]{2}/.+/.+\.shtml$">
> 	ErrorDocument 404 /bling.cfm
> </FilesMatch>
>
> However, this doesn't work... i get a 404 error when i try my request.
> Please help!

Ummm... Aren't you TRYING to get a 404 error?  I guess you are saying you
are getting the INTERNAL 404 error rather than your page.

A couple issues here:

1. <FilesMatch> matches only filenames, not complete paths.

2. It is not very clear exactly what you are trying to accomplish.  It
could be clearer if you supplied a few example URLs that you want to hit
your error handler and a few that you don't.

3. Given that, here are a few guesses at what you want:

This should have very close to the affect that your <FilesMatch> was
trying to get:

<LocationMatch /news/[0-9]{4}/[0-9]{2}/[0-9]{2}/.+/.+\.shtml$">
ErrorDocument 404 /bling.cfm
</FilesMatch>

Another technique might be
<Directory X:/news/*/*/*/*/>
ErrorDocument 404 /blink.cfm
</Directory>
which tries to catch any missing file in the fourth level directory under
news.

If that isn't what you want, you need to be clearer in your problem
description.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message