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: Other ErrorDocument for subdir
Author
flatcircle



Joined: 27 Jun 2006
Posts: 79

PostPosted: Wed 21 May '08 21:46    Post subject: Other ErrorDocument for subdir Reply with quote

Hello,

I have a website running which uses a .htaccess file.

I'm changing a lot of paths in my website and a lot of documents in a specific directory are indexed by Google.

Because all the files will be removed in this dir, a Rewriterule is not an option.

When visitors click on a link in Google to a page I removed, I want to return a custom errorpage where users can click to the new sections of my site but only for that specific directory. With this setup Google will get a 404 status code to clean up the pages which won't exist anymore.

In my virtal host I have AllowOverride All.

In the specific directory, I created a .htaccess file with

ErrorDocument 404 /subdir/customerror.htm

However, I still get the default ErrorDocument from my main site and not the one I specified in the .htaccess in the subdir.

Something else that I'm missing here?

Regards.
Back to top
James Blond
Moderator


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

PostPosted: Wed 21 May '08 23:04    Post subject: Reply with quote

you can work with DirectoryMatch or better LocationMatch, but notice that all subfolder in that subdir will have THAT different ErrorDocument not the default one.
Back to top
flatcircle



Joined: 27 Jun 2006
Posts: 79

PostPosted: Thu 22 May '08 9:25    Post subject: Reply with quote

Exactly what I need!
Thank you very much!

I just read the docs and seems to me that the difference between DirectoryMatch and LocationMatch is that DirectoryMatch also includes subdirs ans LocationMatch not, is that right?
Back to top
James Blond
Moderator


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

PostPosted: Thu 22 May '08 12:16    Post subject: Reply with quote

I've never tried that out. But the docs say so. Trial and error Wink
Back to top


Reply to topic   Topic: Other ErrorDocument for subdir View previous topic :: View next topic
Post new topic   Forum Index -> Apache