httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Block" <ht...@collegepublisher.com>
Subject [users@httpd] Please help me with this error document directive
Date Mon, 08 Dec 2003 15:01:33 GMT
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

Okay... "/news" happens to be a virtual directory (alias) but I don't think
that matters for what I'm trying to do. I've got some programming that is
supposed to create the "ArtsAndEntertainment" directory and then plunk the
".shtml" file into place. However, this process could fail or a request
could come into my server for that file before it was created by my code.

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.

I know I need to use the <directorymatch> or <filematch> tag, or some
combination. Keep in mind the name of the "artsandentertainment" folder will
vary so I have to use an expression. Also, I only want to execute the error
catch if the user specifically tried to access a ".shtml" file.

<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!

Thanks,
Jon


---------------------------------------------------------------------
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