Msg#: 3546593 posted 2:47 pm on Jan 12, 2008 (gmt 0)
I was wondering if theres any thoughts on these two ways of managing redirects and 410's.
Place all code in one main htaccess file in the root directory meaning its grows quite large and every request has to read it. Split the file up so you only place each redirect or wotever code in the specific directory the file would be called from.
Msg#: 3546593 posted 4:57 pm on Jan 12, 2008 (gmt 0)
It's a trade-off between file size and maintainability. On the one hand, you might say, "let the computers do the work" in order to get the benefit of centralized administration, while on the other, you might be more concerned with reducing the work that the server must do to handle each request.
Depending on your traffic, an .htaccess filesize of 250KB might be acceptable, while on a very busy site, a 75KB .htaccess file might introduce a noticeable delay in serving pages.
There are some other "middle of the road" techniques as well. For example, you might add logic to your 410-Gone ruleset to skip processing if the request is not for a particular list of subdirectories. Or skip proicessing if the request is not for "page" filetypes. For example:
Here, all of the RewriteConds are skipped unless the request is for a "page" filetype, due the way that mod_rewrite processes RewriteConds only if the RewriteRule pattern matches (see documentation). As a result, the majority of requests to the site --usually requests for images, CSS, etc.-- will not require the RewriteConds to be processed.